Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
16546 jghali 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.,                                       *
18122 mrdocs 24
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.             *
16546 jghali 25
 ***************************************************************************/
26
#ifndef SCDOCKPALETTE_H
27
#define SCDOCKPALETTE_H
28
 
29
#include <QCloseEvent>
30
#include <QDockWidget>
31
#include <QHideEvent>
32
#include <QKeySequence>
33
#include <QShowEvent>
34
 
35
#include "scribusapi.h"
36
class PrefsContext;
37
 
38
class SCRIBUS_API ScDockPalette : public QDockWidget
39
{
40
        Q_OBJECT
41
 
42
        public:
43
                ScDockPalette( QWidget * parent = NULL, const QString& prefsContext = QString::null, Qt::WFlags f = 0 );
44
                ~ScDockPalette() {};
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);
52
                virtual void setFontSize();
53
 
54
        signals:
55
                /** @brief Let the action for this palette know when something changes and it hasnt caused it */
56
                void paletteShown(bool);
57
 
58
        protected:
59
                /** @brief Set the Preferences context to be used for storage of startup visibility and position and size */
60
                virtual void setPrefsContext(QString context);
61
                void storePosition();
62
                void storePosition(int newX, int newY);
63
                void storeSize();
64
                void storeVisibility(bool);
65
                void storeDockState();
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*);
73
 
74
                PrefsContext* palettePrefs;
75
                QString prefsContextName;
76
                bool visibleOnStartup;
77
                QWidget* originalParent;
78
                QWidget* tempParent;
79
};
80
#endif