Back to index

scribus-ng  1.3.4.dfsg+svn20071115
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 <qevent.h>
00026 #include <qobject.h>
00027 
00028 #include <qpointarray.h>
00029 #include <qptrlist.h>
00030 #include <qmap.h>
00031 #include <qpixmap.h>
00032 #include <qrect.h>
00033 #include <qstring.h>
00034 #include <qvaluestack.h>
00035 #include <qvaluelist.h>
00036 #include <qwidget.h>
00037 
00038 #include "scribusapi.h"
00039 #include "undoobject.h"
00040 #include "scimage.h"
00041 #include "pagestructs.h"
00042 #include "pageitem.h"
00043 class ScPainter;
00044 class ScribusDoc;
00045 class UndoManager;
00046 class UndoState;
00047 struct CopyPasteBuffer;
00048 
00049 #include "text/nlsconfig.h"
00050 
00051 #ifdef NLS_PROTO
00052 #include "text/sctextengine.h"
00053 #include "text/scfont.h"
00054 #include "sctextstruct.h"
00055 class ScText;
00056 class ScStyleRun;
00057 #endif
00058 
00059 class SCRIBUS_API PageItem_TextFrame : public PageItem
00060 {
00061        Q_OBJECT
00062 
00063 public:
00064        PageItem_TextFrame(ScribusDoc *pa, double x, double y, double w, double h, double w2, QString fill, QString outline);
00065        PageItem_TextFrame(const PageItem & p) : PageItem(p) {}
00066        ~PageItem_TextFrame() {};
00067 
00068        virtual PageItem_TextFrame * asTextFrame() { return this; }
00069        
00070        virtual void clearContents();
00071        
00077        virtual void handleModeEditKey(QKeyEvent *k, bool& keyRepeat);
00078        void deleteSelectedTextFromFrame();
00079        void setNewPos(int oldPos, int len, int dir);
00080        void ExpandSel(int dir, int oldPos);
00081        void deselectAll();
00082        
00083        void layout();
00084        double columnWidth();
00085 #ifdef NLS_PROTO
00086        int firstTextItem() const { return itemText.firstFrameItem; }
00087        int lastTextItem() const { return itemText.lastFrameItem; }
00088 #endif
00089        
00090 protected:
00091        virtual void DrawObj_Item(ScPainter *p, QRect e, double sc);
00092        virtual void DrawObj_Post(ScPainter *p);
00093        void drawOverflowMarker(ScPainter *p);
00094        void drawColumnBorders(ScPainter *p);
00095        QRegion availableRegion(QRegion clip);
00096 
00097 #ifdef NLS_PROTO
00098        void DrawLineItem(ScPainter *p, double width,
00099                          ScScriptItem *item, uint itemIndex);
00100 #endif
00101        
00102        bool unicodeTextEditMode;
00103        int unicodeInputCount;
00104        QString unicodeInputString;
00105        
00106 private:
00107        bool cursorBiasBackward;    
00108               
00109        void setShadow();
00110        QString currentShadow;
00111        QMap<QString,StoryText> shadows;
00112 };
00113 
00114 #endif