Back to index

scribus-ng  1.3.4.dfsg+svn20071115
sctoolbar.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008  *   Copyright (C) 2006 by Riku Leino                                      *
00009  *   riku@scribus.info                                                     *
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  *   This program is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00019  *   GNU General Public License for more details.                          *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU General Public License     *
00022  *   along with this program; if not, write to the                         *
00023  *   Free Software Foundation, Inc.,                                       *
00024  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00025  ***************************************************************************/
00026 
00027 #ifndef SCTOOLBAR_H
00028 #define SCTOOLBAR_H
00029 
00030 #include "scribusapi.h"
00031 #include <qtoolbar.h>
00032 
00033 class QMainWindow;
00034 class QString;
00035 class PrefsContext;
00036 class QCloseEvent;
00037 class QToolButton;
00038 class QPopupMenu;
00039 
00040 class SCRIBUS_API ScToolBar : public QToolBar
00041 {
00042        Q_OBJECT
00043 public:
00044        // prefName is the name without tr() that will be used in the preferences for this toolbar
00045        // if using name settings depend on the language
00046        ScToolBar(const QString& name, const QString &prefName, QMainWindow *parent, QDockWindow::Orientation o = QDockWindow::Horizontal);
00047        virtual ~ScToolBar();
00048 
00049        int position();
00050        void storeDockPosition();
00051        void moveDock();
00052        void initVisibility();
00053 
00054 public slots:
00055        void languageChange();
00056 
00057 protected slots:
00058        void slotPlaceChanged(QDockWindow::Place p);
00059        void slotVisibilityChanged(bool visible);
00060        void slotTop();
00061        void slotRight();
00062        void slotBottom();
00063        void slotLeft();
00064        void slotVert();
00065        void slotHor();
00066 
00067 private:
00068        QString m_name;
00069        PrefsContext *m_prefs;
00070        QDockWindow::Orientation floatOrientation;
00071        QToolButton *prefsButton;
00072        QPopupMenu  *popup;
00073        QPopupMenu  *dockMenu;
00074        QPopupMenu  *orientationMenu;
00075 
00076        bool dockTop;
00077        bool dockRight;
00078        bool dockBottom;
00079        bool dockLeft;
00080 
00081        void initPrefsButton();
00082        void storeDockPositions();
00083        void moveDocks();
00084 
00085        enum Orientation { Vert, Hor };
00086 };
00087 
00088 #endif