Scribus
Open source desktop publishing at your fingertips
scrpalettebase.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 /***************************************************************************
8  * Copyright (C) 2005 by Craig Bradney *
9  * cbradney@scribus.info *
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  * This program is distributed in the hope that it will be useful, *
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19  * GNU General Public License for more details. *
20  * *
21  * You should have received a copy of the GNU General Public License *
22  * along with this program; if not, write to the *
23  * Free Software Foundation, Inc., *
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
25  ***************************************************************************/
26 #ifndef SCRPALETTE_BASE_H
27 #define SCRPALETTE_BASE_H
28 
29 #include <QCloseEvent>
30 #include <QDialog>
31 #include <QHideEvent>
32 #include <QKeySequence>
33 #include <QShowEvent>
34 
35 #include "scribusapi.h"
36 class PrefsContext;
37 
38 class SCRIBUS_API ScrPaletteBase : public QDialog
39 {
40  Q_OBJECT
41 
42  public:
43  ScrPaletteBase( QWidget * parent = NULL, const QString& prefsContext = QString::null, bool modal = false, Qt::WindowFlags f = 0 );
44  ~ScrPaletteBase() {};
46  //virtual void keyPressEvent(QKeyEvent *keyEvent);
47  virtual void hide();
48  void startup();
49 
50  public slots:
51  virtual void setPaletteShown(bool);
52  virtual void setFontSize();
53  virtual int exec() { return QDialog::exec();}
54  int exec(QWidget* newParent);
55 
56  signals:
58  void paletteShown(bool);
59 
60  protected:
62  virtual void setPrefsContext(QString context);
63  void storePosition();
64  void storePosition(int newX, int newY);
65  void storeSize();
66  void storeVisibility(bool);
67 
69  virtual void showEvent(QShowEvent *showEvent);
71  virtual void closeEvent(QCloseEvent *closeEvent);
73  virtual void hideEvent(QHideEvent*);
74 
75  PrefsContext* palettePrefs;
76  QString prefsContextName;
77  bool visibleOnStartup;
78  QWidget* originalParent;
79  QWidget* tempParent;
80 
81  protected slots:
82  virtual void reject();
83 };
84 #endif
Definition: prefscontext.h:40
Definition: scrpalettebase.h:38