Subversion Repositories Scribus

Rev

Rev 14743 | Rev 18194 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4430 cbradney 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
*/
1525 cbradney 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.,                                       *
18122 mrdocs 24
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.             *
1525 cbradney 25
 ***************************************************************************/
26
#ifndef SCRPALETTE_BASE_H
27
#define SCRPALETTE_BASE_H
28
 
10223 cbradney 29
#include <QCloseEvent>
30
#include <QDialog>
8501 cbradney 31
#include <QHideEvent>
10223 cbradney 32
#include <QKeySequence>
14743 jghali 33
#include <QShowEvent>
1525 cbradney 34
 
2969 craig 35
#include "scribusapi.h"
1525 cbradney 36
class PrefsContext;
37
 
2969 craig 38
class SCRIBUS_API ScrPaletteBase : public QDialog
1525 cbradney 39
{
40
        Q_OBJECT
41
 
42
        public:
10581 cbradney 43
                ScrPaletteBase( QWidget * parent = NULL, const QString& prefsContext = QString::null, bool modal = false, Qt::WFlags f = 0 );
1525 cbradney 44
                ~ScrPaletteBase() {};
45
                /** @brief Sample way to grab keystrokes, simply calls superclass at this point */
46
                //virtual void keyPressEvent(QKeyEvent *keyEvent);
47
                virtual void hide();
48
                void startup();
49
 
50
        public slots:
51
                virtual void setPaletteShown(bool);
3940 tsoots 52
                virtual void setFontSize();
8428 cbradney 53
                int exec(QWidget* newParent);
1525 cbradney 54
 
55
        signals:
56
                /** @brief Let the action for this palette know when something changes and it hasnt caused it */
57
                void paletteShown(bool);
58
 
59
        protected:
3928 tsoots 60
                /** @brief Set the Preferences context to be used for storage of startup visibility and position and size */
61
                virtual void setPrefsContext(QString context);
1525 cbradney 62
                void storePosition();
63
                void storePosition(int newX, int newY);
64
                void storeSize();
65
                void storeVisibility(bool);
14743 jghali 66
 
67
                /** @brief Restore the geometry of the window when showing it. */
68
                virtual void showEvent(QShowEvent *showEvent);
69
                /** @brief Captures the close event and changes it to hide */
70
                virtual void closeEvent(QCloseEvent *closeEvent);
71
                /** @brief Stores the geometry of the window when hiding. */
72
                virtual void hideEvent(QHideEvent*);
1525 cbradney 73
 
74
                PrefsContext* palettePrefs;
75
                QString prefsContextName;
76
                bool visibleOnStartup;
8428 cbradney 77
                QWidget* originalParent;
78
                QWidget* tempParent;
1525 cbradney 79
 
80
        protected slots:
81
                virtual void reject();
82
};
83
#endif