~ubuntu-branches/ubuntu/saucy/rocs/saucy

« back to all changes in this revision

Viewing changes to RocsCore/DataStructureBackendInterface.h

  • Committer: Package Import Robot
  • Author(s): Rohan Garg, Rohan Garg, Philip Muškovac
  • Date: 2013-06-21 02:04:20 UTC
  • mfrom: (1.1.27)
  • Revision ID: package-import@ubuntu.com-20130621020420-lzlui9y7qc6w3xog
Tags: 4:4.10.80-0ubuntu1
[ Rohan Garg ]
* New upstream release

[ Philip Muškovac ]
* Build-depend on libgrantlee-dev and libx11-dev
* Update rocs.install and not-installed 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    This file is part of Rocs.
 
3
    Copyright 2011  Tomaz Canabrava <tomaz.canabrava@gmail.com>
 
4
 
 
5
    This program is free software; you can redistribute it and/or
 
6
    modify it under the terms of the GNU General Public License as
 
7
    published by the Free Software Foundation; either version 2 of
 
8
    the License, or (at your option) any later version.
 
9
 
 
10
    This program is distributed in the hope that it will be useful,
 
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
    GNU General Public License for more details.
 
14
 
 
15
    You should have received a copy of the GNU General Public License
 
16
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
*/
 
18
 
 
19
 
 
20
#ifndef DATASTRUCTUREBACKENDINTERFACE_H
 
21
#define DATASTRUCTUREBACKENDINTERFACE_H
 
22
 
 
23
#include <kplugininfo.h>
 
24
 
 
25
//Qt classes
 
26
class QLayout;
 
27
class QGraphicsItem;
 
28
 
 
29
//Rocs Classes
 
30
class DataStructure;
 
31
class Data;
 
32
class Pointer;
 
33
class Document;
 
34
 
 
35
// KClasses
 
36
class KComponentData;
 
37
 
 
38
#include "RocsCoreExport.h"
 
39
#include "CoreTypes.h"
 
40
 
 
41
 
 
42
class ROCSLIB_EXPORT DataStructureBackendInterface : public QObject
 
43
{
 
44
    Q_OBJECT
 
45
 
 
46
public:
 
47
    DataStructureBackendInterface(const KComponentData& instance, QObject* parent);
 
48
 
 
49
    virtual ~DataStructureBackendInterface();
 
50
    virtual DataStructurePtr createDataStructure(Document * parent) = 0;
 
51
    virtual DataStructurePtr convertToDataStructure(DataStructurePtr, Document* parent) = 0;
 
52
 
 
53
    /** @brief Check if is possíble to convert from the doc document to this data structure.
 
54
     * If is possible to convert, is returned a true value, else, before return false, is good to implement in each scritp a message saying to user that not is possible to convert and asking if the conversion should proceed. If the user say to carry on, then true must be returned, otherwise false.
 
55
     */
 
56
    virtual bool canConvertFrom(Document* doc) const = 0;
 
57
 
 
58
    /** @brief return the translated name to be used in user visible strings
 
59
     */
 
60
    QString name();
 
61
 
 
62
    /** @brief return the internal name from plugin.
 
63
     * This string is not translated and should be used to differentiate
 
64
     * the data structures. It is useful when some piece of code is only
 
65
     * applicable to some kind of structures
 
66
     */
 
67
    QString internalName();
 
68
 
 
69
    virtual QGraphicsItem * dataItem(DataPtr data) const = 0;
 
70
    virtual QGraphicsItem * pointerItem(PointerPtr pointer) const = 0;
 
71
 
 
72
    virtual QLayout* dataExtraProperties(DataPtr data, QWidget* widget) const;
 
73
    virtual QLayout* pointerExtraProperties(PointerPtr pointer, QWidget* widget)const;
 
74
    virtual QLayout* dataStructureExtraProperties(DataStructurePtr dataStructure, QWidget* widget)const;
 
75
 
 
76
};
 
77
 
 
78
 
 
79
#endif // DataStructurePLUGININTERFACE_H