summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-sheet/cellformat.h
authorar <ar>2004-06-12 09:24:00 (UTC)
committer ar <ar>2004-06-12 09:24:00 (UTC)
commit7a62e8e3601ee98f5f06261c361fe8132334cd56 (patch) (side-by-side diff)
tree72e1e68878e32c70140fe1de478bced96670e348 /noncore/apps/opie-sheet/cellformat.h
parent3fbf3cb264200c5ac11dbef43a51f3ab2a969587 (diff)
downloadopie-7a62e8e3601ee98f5f06261c361fe8132334cd56.zip
opie-7a62e8e3601ee98f5f06261c361fe8132334cd56.tar.gz
opie-7a62e8e3601ee98f5f06261c361fe8132334cd56.tar.bz2
- rename sheet-qt -> opie-sheet
- format source code for a better readability
Diffstat (limited to 'noncore/apps/opie-sheet/cellformat.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-sheet/cellformat.h142
1 files changed, 82 insertions, 60 deletions
diff --git a/noncore/apps/opie-sheet/cellformat.h b/noncore/apps/opie-sheet/cellformat.h
index b569b7f..e07af9c 100644
--- a/noncore/apps/opie-sheet/cellformat.h
+++ b/noncore/apps/opie-sheet/cellformat.h
@@ -1,11 +1,30 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
@@ -15,7 +34,12 @@
#ifndef CELLFORMAT_H
#define CELLFORMAT_H
+#include "sheet.h"
+
+/* OPIE */
#include <qpe/fontdatabase.h>
+
+/* QT */
#include <qdialog.h>
#include <qtabwidget.h>
#include <qlayout.h>
@@ -23,22 +47,20 @@
#include <qcheckbox.h>
#include <qpushbutton.h>
-#include "sheet.h"
-
class BorderEditor: public QFrame
{
- Q_OBJECT
+ Q_OBJECT
- // QT objects
- QPen penTop, penBottom, penLeft, penRight, penHorz, penVert;
+ // QT objects
+ QPen penTop, penBottom, penLeft, penRight, penHorz, penVert;
- // Private functions
- void drawContents(QPainter *p);
+ // Private functions
+ void drawContents(QPainter *p);
- // Reimplemented QFrame functions
- void mouseReleaseEvent(QMouseEvent *e);
+ // Reimplemented QFrame functions
+ void mouseReleaseEvent(QMouseEvent *e);
- public:
+public:
// Definitions
enum BorderArea {None, Top, Bottom, Left, Right, Horz, Vert};
@@ -49,52 +71,52 @@ class BorderEditor: public QFrame
QPen getPen(BorderArea area);
QPen getDefaultPen() { return QPen(Qt::black, 1, Qt::DotLine); }
- signals:
+signals:
void clicked(BorderEditor::BorderArea);
};
class CellFormat: public QDialog
{
- Q_OBJECT
-
- enum comboType {COMBO_OTHER, COMBO_WIDTH, COMBO_FONT, COMBO_SIZE, COMBO_STYLE, COMBO_COLOR, COMBO_VALIGN, COMBO_HALIGN};
-
- // QT objects
- QBoxLayout *box;
- QTabWidget *tabs;
- QWidget *widgetBorders, *widgetBackground, *widgetFont, *widgetAlignment;
- QComboBox *comboBordersWidth, *comboBordersColor, *comboBackgroundColor, *comboBackgroundStyle, *comboFontColor, *comboFontSize, *comboFontFamily, *comboAlignmentVertical, *comboAlignmentHorizontal;
- QCheckBox *checkFontBold, *checkFontItalic, *checkAlignmentWrap;
- QPushButton *buttonBordersDefaults, *buttonBackgroundDefaults, *buttonFontDefaults, *buttonAlignmentDefaults;
- QFrame *frameBackground, *frameFont, *frameAlignment;
- QBrush brushBackground;
- QFont fontFont;
- QColor fontColor;
- Qt::AlignmentFlags textAlignment;
- FontDatabase fontDB;
-
- // Other objects & variables
- Sheet *sheet;
- BorderEditor *borderEditor;
- bool changedFont, changedAlign, changedBrush;
-
- // Private functions
- void createWidthCombo(QComboBox *combo);
- void createFontCombo(QComboBox *combo);
- void createHAlignCombo(QComboBox *combo);
- void createVAlignCombo(QComboBox *combo);
- void createStyleCombo(QComboBox *combo);
- void createSizeCombo(QComboBox *combo);
- void createColorCombo(QComboBox *combo);
- QComboBox *createCombo(comboType type, QWidget *parent, const QString &caption, int y);
-
- int findHAlignIndex(Qt::AlignmentFlags flag);
- int findVAlignIndex(Qt::AlignmentFlags flag);
- int findComboItemIndex(QComboBox *combo, const QString &item);
- int findColorIndex(const QColor &color);
- int findBrushStyleIndex(Qt::BrushStyle style);
-
- private slots:
+ Q_OBJECT
+
+ enum comboType {COMBO_OTHER, COMBO_WIDTH, COMBO_FONT, COMBO_SIZE, COMBO_STYLE, COMBO_COLOR, COMBO_VALIGN, COMBO_HALIGN};
+
+ // QT objects
+ QBoxLayout *box;
+ QTabWidget *tabs;
+ QWidget *widgetBorders, *widgetBackground, *widgetFont, *widgetAlignment;
+ QComboBox *comboBordersWidth, *comboBordersColor, *comboBackgroundColor, *comboBackgroundStyle, *comboFontColor, *comboFontSize, *comboFontFamily, *comboAlignmentVertical, *comboAlignmentHorizontal;
+ QCheckBox *checkFontBold, *checkFontItalic, *checkAlignmentWrap;
+ QPushButton *buttonBordersDefaults, *buttonBackgroundDefaults, *buttonFontDefaults, *buttonAlignmentDefaults;
+ QFrame *frameBackground, *frameFont, *frameAlignment;
+ QBrush brushBackground;
+ QFont fontFont;
+ QColor fontColor;
+ Qt::AlignmentFlags textAlignment;
+ FontDatabase fontDB;
+
+ // Other objects & variables
+ Sheet *sheet;
+ BorderEditor *borderEditor;
+ bool changedFont, changedAlign, changedBrush;
+
+ // Private functions
+ void createWidthCombo(QComboBox *combo);
+ void createFontCombo(QComboBox *combo);
+ void createHAlignCombo(QComboBox *combo);
+ void createVAlignCombo(QComboBox *combo);
+ void createStyleCombo(QComboBox *combo);
+ void createSizeCombo(QComboBox *combo);
+ void createColorCombo(QComboBox *combo);
+ QComboBox *createCombo(comboType type, QWidget *parent, const QString &caption, int y);
+
+ int findHAlignIndex(Qt::AlignmentFlags flag);
+ int findVAlignIndex(Qt::AlignmentFlags flag);
+ int findComboItemIndex(QComboBox *combo, const QString &item);
+ int findColorIndex(const QColor &color);
+ int findBrushStyleIndex(Qt::BrushStyle style);
+
+private slots:
void borderClicked(BorderEditor::BorderArea area);
void backgroundClicked(int index);
void fontClicked(bool on);
@@ -106,7 +128,7 @@ class CellFormat: public QDialog
void slotFontDefaults();
void slotAlignmentDefaults();
- public:
+public:
CellFormat(QWidget *parent=0);
~CellFormat();