Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

pageitem_textframe.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                           pageitem.h  -  description
00009                              -------------------
00010     copyright            : Scribus Team
00011  ***************************************************************************/
00012 
00013 /***************************************************************************
00014  *                                                                         *
00015  *   This program is free software; you can redistribute it and/or modify  *
00016  *   it under the terms of the GNU General Public License as published by  *
00017  *   the Free Software Foundation; either version 2 of the License, or     *
00018  *   (at your option) any later version.                                   *
00019  *                                                                         *
00020  ***************************************************************************/
00021 
00022 #ifndef PAGEITEMTEXTFRAME_H
00023 #define PAGEITEMTEXTFRAME_H
00024 
00025 #include <QMap>
00026 #include <QRectF>
00027 #include <QString>
00028 #include <QKeyEvent>
00029 
00030 #include "scribusapi.h"
00031 #include "pageitem.h"
00032 
00033 class ScPainter;
00034 class ScribusDoc;
00035 
00036 #include "text/nlsconfig.h"
00037 
00038 #ifdef NLS_PROTO
00039 #include "text/sctextengine.h"
00040 #include "text/scfont.h"
00041 #include "sctextstruct.h"
00042 class ScText;
00043 class ScStyleRun;
00044 #endif
00045 
00046 class SCRIBUS_API PageItem_TextFrame : public PageItem
00047 {
00048     Q_OBJECT
00049 
00050 public:
00051     PageItem_TextFrame(ScribusDoc *pa, double x, double y, double w, double h, double w2, QString fill, QString outline);
00052     PageItem_TextFrame(const PageItem & p) : PageItem(p) {}
00053     ~PageItem_TextFrame() {};
00054 
00055     virtual PageItem_TextFrame * asTextFrame() { return this; }
00056     
00057     virtual void clearContents();
00058     
00064     virtual void handleModeEditKey(QKeyEvent *k, bool& keyRepeat);
00065     void deleteSelectedTextFromFrame();
00066     void setNewPos(int oldPos, int len, int dir);
00067     void ExpandSel(int dir, int oldPos);
00068     void deselectAll();
00069     
00070     virtual void invalidateLayout();
00071     virtual void layout();
00072 
00073     double columnWidth();
00074 #ifdef NLS_PROTO
00075     int firstTextItem() const { return itemText.firstFrameItem; }
00076     int lastTextItem() const { return itemText.lastFrameItem; }
00077 #endif
00078     
00079 protected:
00080     virtual void DrawObj_Item(ScPainter *p, QRectF e, double sc);
00081     virtual void DrawObj_Post(ScPainter *p);
00082     void drawOverflowMarker(ScPainter *p);
00083     void drawColumnBorders(ScPainter *p);
00084     QRegion availableRegion(QRegion clip);
00085 
00086 #ifdef NLS_PROTO
00087     void DrawLineItem(ScPainter *p, double width,
00088                       ScScriptItem *item, uint itemIndex);
00089 #endif
00090     
00091     bool unicodeTextEditMode;
00092     int unicodeInputCount;
00093     QString unicodeInputString;
00094     
00095     virtual bool createInfoGroup(QFrame *, QGridLayout *);
00096     virtual bool createContextMenu(QMenu *, int);
00097     virtual void applicableActions(QStringList& actionList);
00098     virtual QString infoDescription();
00099     
00100 private:
00101     bool cursorBiasBackward;
00102 
00103     void setShadow();
00104     QString currentShadow;
00105     QMap<QString,StoryText> shadows;
00106 };
00107 
00108 #endif
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.