1
#ifndef _KVI_UTOOLBAR_H_INCLUDED_
2
#define _KVI_UTOOLBAR_H_INCLUDED_
5
// File : kvi_popupmenu.h (/usr/build/NEW_kvirc/kvirc/src/kvirc/kvi_popupmenu.h)
6
// Last major modification : Wed Apr 21 1999 21:36:10 by Szymon Stefanek
8
// This file is part of the KVirc irc client distribution
9
// Copyright (C) 1999-2000 Szymon Stefanek (stefanek@tin.it)
10
// Copyright (C) 1999-2000 Till Busch (buti@geocities.com)
12
// This program is FREE software. You can redistribute it and/or
13
// modify it under the terms of the GNU General Public License
14
// as published by the Free Software Foundation; either version 2
15
// of the License, or (at your opinion) any later version.
17
// This program is distributed in the HOPE that it will be USEFUL,
18
// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
// See the GNU General Public License for more details.
22
// You should have received a copy of the GNU General Public License
23
// along with this program. If not, write to the Free Software Foundation,
24
// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28
#include <qtoolbutton.h>
33
#include <qpopupmenu.h>
35
#include "kvi_string.h"
36
#include "kvi_popupmenu.h"
37
#include "kvi_style.h"
39
//class KviUserToolBar;
41
class KviUserToolBarTemplate;
43
typedef struct KviUserToolBarData
49
KviToolButton *button;
56
// An item with id=0 , menu=0 and buffer = " " is a separator.
57
// Normal menu item buffers have the initial spaces stripped at
63
//class KviTransparentWidget;
65
class KviUserToolBar : public QToolBar
67
friend class KviDlgScript;
70
KviUserToolBar(KviFrame *frame,QMainWindow::ToolBarDock dock);
71
KviUserToolBar(KviFrame *frame, QWidget *parent);
74
// KviTransparentWidget * m_pFiller;
78
// QPopupMenu *m_pEditPopup; // Qt KILLS THIS
80
enum ToolButtonType { Separator, Button, Menu };
81
QList<KviUserToolBarData> * m_pDataList;
82
bool m_bLocked; //Protects against self-modification
84
int insertNormalItem(const char *name, const char *sbar,const char *img,const char *buffer, KviPopupMenu *menu=0);
85
void insertSeparatorItem();
86
void copyFromTemplate(KviUserToolBarTemplate *toolbar, bool bEditPopup = true);
90
void buttonClicked(int id);
93
// virtual bool eventFilter(QObject * o,QEvent *e);
94
// void slot_editToolBar();
95
void popupClicked(const KviStr &dataBuffer);
99
class KviUserToolBarTemplate
102
KviUserToolBarTemplate();
103
~KviUserToolBarTemplate();
107
enum ToolButtonType { Separator, Button, Menu };
108
QList<KviUserToolBarData> * m_pDataList;
109
void copyFromToolBar(KviUserToolBar *toolbar);
110
int insertSeparatorItem();
111
int insertNormalItem(const char *name, const char *sbar,const char *img,const char *buffer, KviPopupMenu * menu=0);
112
static bool saveToolBarTemplate(const char *filename);
113
static bool loadToolBarTemplate(const char *filename,KviStr &error);
118
void buildDataBuffer(KviStr &str);
119
bool loadFromDataBuffer(KviStr &buffer,KviStr &error);
122
class KviToolButton : public KviToolBarButton
126
KviToolButton(int id, const QPixmap & pm, const char * textLabel, const char * grouptext, QObject * receiver, const char * slot, QToolBar * parent);
136
#endif //!_KVI_UTOOLBAR_H_INCLUDED_