Ananas Library 0.9.5
wgrouptree.h
1/****************************************************************************
2** $Id: wgrouptree.h,v 1.9 2008/04/12 18:05:35 app Exp $
3**
4** Header file of the document plugin of Ananas
5** Designer and Engine applications
6**
7** Created : 20031201
8**
9** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
10**
11** This file is part of the Ananas Plugins of the Ananas
12** automation accounting system.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21**
22** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
23** See http://www.leaderit.ru/gpl/ for GPL licensing information.
24**
25** Contact org@leaderit.ru if any conditions of this licensing are
26** not clear to you.
27**
28**********************************************************************/
29
30#ifndef WGROUPTREE_H
31#define WGROUPTREE_H
32
33#include <qlistview.h>
34#include <qwidgetplugin.h>
35#include <qwidget.h>
36#include "awidget.h"
37
38class wGroupTreeItem;
39class wTreeView;
40
41class QT_WIDGET_PLUGIN_EXPORT wGroupTree : public aWidget
42{
43 Q_OBJECT
44public:
45 wTreeView *tree;
46 wGroupTreeItem *root;
47
48 wGroupTree( QWidget *parent = 0, WFlags fl = 0 );
49 virtual ~wGroupTree();
50
51 virtual void initObject( aDatabase *adb );
52 virtual QDialog* createEditor( QWidget *parent );
53 virtual QToolBar* createToolBar( QMainWindow *parent );
54 virtual aObject *createDBObject( aCfgItem obj, aDatabase *adb );
55 void buildGroupTree( aCfgItem obj, aCatGroup * cg1, wGroupTreeItem * wG );
56 wGroupTreeItem *findItem( ANANAS_UID id );
57public slots:
58 void findGroupTree();
59 void NewGroup();
60 void DeleteGroup();
61 void EditGroup();
62 virtual QString Uid() { return QString("%1").arg(currentId); };
63// void UpdateItem( aCatGroup *g );
64private slots:
65 void on_selected( ANANAS_UID element );
66// void updateItem( ANANAS_UID element );
67 void updateItem( ANANAS_UID element );
68 void on_selectionChanged( QListViewItem *);
69 void dropped(QDropEvent*);
70signals:
71 virtual void selected( ANANAS_UID group );
72 virtual void selectionChanged( const Q_ULLONG );
73protected:
74 virtual void keyPressEvent ( QKeyEvent *e );
75private:
76 Q_ULLONG currentId;
77};
78
79
80
81class wGroupTreeItem : public QListViewItem
82{
83public:
84 ANANAS_UID id;
85 int level;
86 wGroupTreeItem( QListView *parent, const QString &name = QString::null );
87 wGroupTreeItem( wGroupTreeItem *parent, wGroupTreeItem *after, const QString &name = QString::null, int newlevel = 0, ANANAS_UID newid = 0 );
88 wGroupTreeItem( wGroupTreeItem *parent, wGroupTreeItem *after, aCatGroup *g = 0 );
89 virtual ~wGroupTreeItem();
90 wGroupTreeItem *parentItem();
91private:
92};
93
94class wTreeView : public QListView
95{
96 Q_OBJECT
97public:
98 wTreeView(QWidget * parent);
99protected:
100 virtual void dragEnterEvent(QDragEnterEvent *);
101 virtual void dragMoveEvent(QDragMoveEvent *);
102 virtual void dropEvent(QDropEvent *);
103};
104
105#endif // WGROUPTREE_H
Definition acatalogue.h:155
Definition adatabase.h:78
Definition aobject.h:64
Definition awidget.h:53
virtual QDialog * createEditor(QWidget *parent)
Definition awidget.cpp:347
virtual aObject * createDBObject(aCfgItem obj, aDatabase *)
Definition awidget.cpp:135
virtual QToolBar * createToolBar(QMainWindow *parent)
Definition awidget.cpp:152
virtual void initObject(aDatabase *adb)
Definition awidget.cpp:187
Definition wgrouptree.h:82
Definition wgrouptree.h:42
Definition wgrouptree.h:95