kpresenter
KPrCanvas Class Reference
#include <KPrCanvas.h>
Inherits QWidget.
Detailed Description
Class KPCanvas - There is a single instance of this class for a given view.It manages the graphical representation of all the objects.
Definition at line 82 of file KPrCanvas.h.
Public Slots | |
void | exitEditMode (bool repaint=true) |
void | clipCut () |
void | clipCopy () |
void | clipPaste () |
void | deleteObjs () |
void | copyObjs () |
void | copyOasisObjs () |
void | chPic () |
void | picViewOriginalSize () |
void | picViewOrig640x480 () |
void | picViewOrig800x600 () |
void | picViewOrig1024x768 () |
void | picViewOrig1280x1024 () |
void | picViewOrig1600x1200 () |
void | picViewOrigFactor () |
void | setActivePage (KPrPage *active) |
void | setPaintGuides (bool state) |
Signals | |
void | fontChanged (const QFont &) |
void | colorChanged (const QColor &) |
void | alignChanged (int) |
void | stopAutomaticPresentation () |
void | restartPresentation () |
void | objectSelectedChanged () |
void | objectSizeChanged () |
void | currentObjectEditChanged () |
void | selectionChanged (bool hasSelection) |
void | sigMouseWheelEvent (QWheelEvent *) |
Public Member Functions | |
KPrCanvas (QWidget *parent=0, const char *name=0, KPrView *_view=0) | |
~KPrCanvas () | |
KPrView * | getView () const |
int | diffx () const |
int | diffy () const |
void | setDiffX (int _diffX) |
void | setDiffY (int _diffY) |
void | scrollX (int x) |
void | scrollY (int y) |
void | selectAllObj () |
void | deSelectAllObj () |
void | selectObj (KPrObject *) |
void | deSelectObj (KPrObject *) |
void | setTextFormat (const KoTextFormat &format, int flags) |
void | setTextColor (const QColor &) |
void | setTextBackgroundColor (const QColor &) |
void | setTextAlign (int) |
void | setTextDepthPlus () |
void | setTextDepthMinus () |
void | setNewRightIndent (double _rightIndent) |
void | setNewLeftIndent (double _leftIndent) |
void | setNewFirstIndent (double _firstIndent) |
void | setTabList (const KoTabulatorList &tabList) |
void | setTextBold (bool b) |
void | setTextItalic (bool b) |
void | setTextUnderline (bool b) |
void | setTextStrikeOut (bool b) |
void | setTextFamily (const QString &f) |
void | setTextPointSize (int s) |
void | setTextSubScript (bool b) |
void | setTextSuperScript (bool b) |
void | setTextDefaultFormat () |
void | setIncreaseFontSize () |
void | setDecreaseFontSize () |
KPrTextObject * | kpTxtObj () const |
void | startScreenPresentation (double zoomX, double zoomY, int curPgNum=-1) |
void | stopScreenPresentation () |
bool | pNext (bool gotoNextPage=false) |
bool | pPrev (bool gotoPreviousPage=false) |
unsigned int | presPage () const |
int | presStep () const |
int | numPresSteps () const |
int | numPresPages () const |
bool | canAssignEffect (QPtrList< KPrObject > &objs) const |
void | print (QPainter *, KPrinter *, float, float) |
void | setPartEntry (KoDocumentEntry &_e) |
void | setToolEditMode (ToolEditMode _m, bool updateView=true) |
void | setAutoForm (const QString &_autoform) |
void | drawPageInPix (QPixmap &, int pgnum, int zoom, bool forceRealVariableValue=false, int forceWidth=0, int forceHeight=0) |
bool | exportPage (int nPage, int nWidth, int nHeight, const KURL &fileURL, const char *format, int quality=-1) |
void | gotoPage (int pg) |
void | presGotoFirstPage () |
KPrPage * | activePage () const |
bool | oneObjectTextExist () const |
bool | oneObjectTextSelected () const |
bool | isOneObjectSelected () const |
QPtrList< KPrTextObject > | selectedTextObjs () const |
QPtrList< KoTextFormatInterface > | applicableTextInterfaces () const |
QPtrList< KPrTextObject > | applicableTextObjects () const |
void | setMouseSelectedObject (bool b) |
bool | haveASelectedPartObj () const |
bool | haveASelectedGroupObj () const |
bool | haveASelectedPixmapObj () const |
KPrTextView * | currentTextObjectView () const |
QPtrList< KPrObject > | objectList () const |
const QPtrList< KPrObject > & | getObjectList () const |
void | playSound (const QString &soundFileName) |
void | stopSound () |
void | dragStarted () |
void | setXimPosition (int x, int y, int w, int h, QFont *f) |
void | createEditing (KPrTextObject *textObj) |
void | insertLine (const KoPoint &startPoint, const KoPoint &endPoint) |
void | insertRect (const KoRect &rect) |
void | insertEllipse (const KoRect &rect) |
void | insertPie (const KoRect &rect) |
KPrTextObject * | insertTextObject (const KoRect &rect) |
void | insertPicture (const KoRect &rect) |
void | changePicture (const KURL &url, QWidget *window) |
int | numberOfObjectSelected () const |
KPrObject * | getSelectedObj () const |
KPrPixmapObject * | getSelectedImage () const |
bool | getEditMode () const |
void | ungroupObjects () |
void | groupObjects () |
unsigned int | objNums () const |
void | ensureVisible (int x, int y, int xmargin, int ymargin) |
KoRect | objectRect (bool all) const |
void | scrollTopLeftPoint (const QPoint &pos) |
void | textContentsToHeight () |
void | textObjectToContents () |
void | flipObject (bool _horizontal) |
void | lowerObjs (bool backward) |
void | raiseObjs (bool forward) |
void | alignObjects (AlignType at) |
bool | canMoveOneObject () const |
QPtrList< KPrTextObject > | listOfTextObjs () const |
QPixmap | getPicturePixmap () const |
void | closeObject (bool _close) |
void | layout () |
void | alignVertical (VerticalAlignmentType _type) |
void | savePicture () |
void | dropImage (QMimeSource *data, bool resizeImageToOriginalSize=false, int posX=10, int posY=10) |
KoGuides & | guideLines () |
void | objectPopup (KPrObject *object, const QPoint &point) |
Protected Member Functions | |
virtual void | paintEvent (QPaintEvent *) |
void | drawBackground (QPainter *painter, const QRect &rect, KPrPage *page, bool edit=false) const |
void | drawAllObjectsInPage (QPainter *painter, const QPtrList< KPrObject > &obj, int pageNum) const |
void | drawObjectsPres (QPainter *painter, const QPtrList< KPrObject > &_objects, PresStep step) const |
void | drawObjectsEdit (QPainter *painter, const KoRect &rect, const QPtrList< KPrObject > &_objects, SelectionMode selectionMode, int page) const |
void | drawObjects (QPainter *painter, const QPtrList< KPrObject > &objects, SelectionMode selectionMode, bool contour, KPrTextView *textView, int pageNum) const |
void | drawEditPage (QPainter *painter, const QRect &_rect, KPrPage *page, SelectionMode selectionMode) const |
void | drawPresPage (QPainter *painter, const QRect &_rect, PresStep step) const |
void | drawGrid (QPainter *painter, const QRect &rect2) const |
bool | finishObjectEffects () |
bool | finishPageEffect (bool cancel=false) |
void | drawCurrentPageInPix (QPixmap &) const |
virtual void | mousePressEvent (QMouseEvent *e) |
virtual void | mouseReleaseEvent (QMouseEvent *e) |
virtual void | mouseMoveEvent (QMouseEvent *e) |
virtual void | mouseDoubleClickEvent (QMouseEvent *e) |
virtual void | wheelEvent (QWheelEvent *e) |
virtual void | resizeEvent (QResizeEvent *e) |
virtual bool | close (bool alsoDelete) |
KPrObject * | getObjectAt (const KoPoint &pos, bool withoutProtected=false) |
virtual void | focusInEvent (QFocusEvent *) |
virtual void | focusOutEvent (QFocusEvent *) |
virtual void | enterEvent (QEvent *e) |
virtual void | leaveEvent (QEvent *e) |
virtual void | dragEnterEvent (QDragEnterEvent *e) |
virtual void | dragMoveEvent (QDragMoveEvent *e) |
virtual void | dropEvent (QDropEvent *e) |
virtual void | keyPressEvent (QKeyEvent *e) |
virtual void | keyReleaseEvent (QKeyEvent *e) |
virtual void | imStartEvent (QIMEvent *e) |
virtual void | imComposeEvent (QIMEvent *e) |
virtual void | imEndEvent (QIMEvent *e) |
void | eraseEmptySpace (QPainter *painter, const QRegion &emptySpaceRegion, const QBrush &brush) const |
void | setupMenus () |
unsigned int | currPgNum () const |
QColor | txtBackCol () const |
bool | spInfiniteLoop () const |
bool | spShowEndOfPresentationSlide () const |
bool | spManualSwitch () const |
QRect | getPageRect (bool decBorders=true) const |
unsigned int | pageNums () const |
void | _repaint (bool erase=true) |
void | _repaint (const QRect &r) |
void | _repaint (KPrObject *o) |
void | printPage (QPainter *, PresStep step, KPrinter *printer, int rows, int cols) |
void | doObjEffects (bool isAllreadyPainted=false) |
KPrPartObject * | insertObject (const KoRect &rect) |
void | insertAutoform (const KoRect &rect) |
void | insertFreehand (const KoPointArray &_pointArray) |
void | insertPolyline (const KoPointArray &_pointArray) |
void | insertCubicBezierCurve (const KoPointArray &_pointArray) |
void | insertPolygon (const KoPointArray &_pointArray) |
void | insertClosedLine (const KoPointArray &_pointArray) |
void | selectNext () |
void | selectPrev () |
void | scalePixmapToBeOrigIn (const KoSize ¤tSize, const KoSize &pgSize, const QSize &presSize, KPrPixmapObject *obj) |
bool | getPixmapOrigAndCurrentSize (KPrPixmapObject *&obj, KoSize *origSize, KoSize *currentSize) |
void | setTextBackground (KPrTextObject *obj) |
virtual bool | eventFilter (QObject *o, QEvent *e) |
virtual bool | focusNextPrevChild (bool) |
void | endDrawPolyline () |
void | drawCubicBezierCurve (QPainter &p, KoPointArray &points) |
void | endDrawCubicBezierCurve () |
void | redrawCubicBezierCurve (QPainter &p) |
void | printRTDebug (int info) |
KoRect | getAlignBoundingRect () const |
Constructor & Destructor Documentation
KPrCanvas::KPrCanvas | ( | QWidget * | parent = 0 , |
|
const char * | name = 0 , |
|||
KPrView * | _view = 0 | |||
) |
KPrCanvas::~KPrCanvas | ( | ) |
Member Function Documentation
void KPrCanvas::startScreenPresentation | ( | double | zoomX, | |
double | zoomY, | |||
int | curPgNum = -1 | |||
) |
Start a screen presentation All pages if curPgNum
is -1, otherwise just curPgNum
(1-based).
Definition at line 2914 of file KPrCanvas.cpp.
bool KPrCanvas::pNext | ( | bool | gotoNextPage = false |
) |
Go to the next step in the presentation.
gotoNextPage: if is set to true go to beginning of the next page.
Definition at line 2997 of file KPrCanvas.cpp.
bool KPrCanvas::pPrev | ( | bool | gotoPreviousPage = false |
) |
Go to previous step of the presentation.
gotoPreviousPage: if is set to true go to beginning of the previous page.
Definition at line 3163 of file KPrCanvas.cpp.
unsigned int KPrCanvas::presPage | ( | ) | const [inline] |
int KPrCanvas::presStep | ( | ) | const [inline] |
void KPrCanvas::drawPageInPix | ( | QPixmap & | _pix, | |
int | pgnum, | |||
int | zoom, | |||
bool | forceRealVariableValue = false , |
|||
int | forceWidth = 0 , |
|||
int | forceHeight = 0 | |||
) |
Draw page into QPixmap.
Draws page pgnum of the currently open presentation into a QPixmap using the specified zoom factor (or fixed width/height dimensions, resp.)
Set forceWidth and/or forceHeight to override the zoom factor and obtain a pixmap of the specified width and/or height. By omitting one of them you make sure that the aspect ratio of your page is used for the resulting image.
- See also:
- exportPage
Definition at line 3238 of file KPrCanvas.cpp.
bool KPrCanvas::exportPage | ( | int | nPage, | |
int | nWidth, | |||
int | nHeight, | |||
const KURL & | fileURL, | |||
const char * | format, | |||
int | quality = -1 | |||
) |
Save page to bitmap file.
Export a page of the currently open presentation to disk using a bitmap format like e.g. PNG. This method uses a QPixmap::save() call.
- Parameters:
-
nPage the internally used 0-based page number nWidth the desired image width in px nHeight the desired image height in px fileURL the URL of the image file to be created: if this does not point to a local file a KTempFile is created by QPixmap::save() which is then copied over to the desired location. format the format of the image file (see QPixmap::save()) quality the quality of the image (see QPixmap::save())
exportPage( 0, s, 800, 600, "/home/khz/page0.png", "PNG", 100 );
- Returns:
- True if the file was written successfully.
- See also:
- drawPageInPix, KPrViewIface::exportPage
Definition at line 2349 of file KPrCanvas.cpp.
void KPrCanvas::presGotoFirstPage | ( | ) |
Go to first slide of presentation.
Used in presentation mode.
Definition at line 4125 of file KPrCanvas.cpp.
QPtrList< KPrTextObject > KPrCanvas::selectedTextObjs | ( | ) | const |
QPtrList< KoTextFormatInterface > KPrCanvas::applicableTextInterfaces | ( | ) | const |
Returns the list of interfaces to use for changing the text format.
This can be either the currently edited text object, or the list of text objects currently selected
Definition at line 2877 of file KPrCanvas.cpp.
QPtrList< KPrTextObject > KPrCanvas::applicableTextObjects | ( | ) | const |
Returns the list of text objects, either selected or activated.
Definition at line 2866 of file KPrCanvas.cpp.
void KPrCanvas::dragStarted | ( | ) | [inline] |
void KPrCanvas::insertLine | ( | const KoPoint & | startPoint, | |
const KoPoint & | endPoint | |||
) |
Add a line.
- Parameters:
-
startPoint the start point of the line endPoint the end point of the line
Definition at line 3661 of file KPrCanvas.cpp.
void KPrCanvas::insertRect | ( | const KoRect & | rect | ) |
Add a rectangle.
- Parameters:
-
rect the size and position of the rectangle
Definition at line 3690 of file KPrCanvas.cpp.
void KPrCanvas::insertEllipse | ( | const KoRect & | rect | ) |
Add a ellipse.
- Parameters:
-
rect the size and position of the ellipse
Definition at line 3697 of file KPrCanvas.cpp.
void KPrCanvas::insertPie | ( | const KoRect & | rect | ) |
Add a pie/arc/chord.
- Parameters:
-
rect the size and position of the pie/arc/chord
Definition at line 3704 of file KPrCanvas.cpp.
KPrTextObject * KPrCanvas::insertTextObject | ( | const KoRect & | rect | ) |
Add a text object.
- Parameters:
-
rect the size and position of the text object
Definition at line 3654 of file KPrCanvas.cpp.
void KPrCanvas::insertPicture | ( | const KoRect & | rect | ) |
Add a picture.
- Parameters:
-
rect the size and position of the picture
Definition at line 3796 of file KPrCanvas.cpp.
KoRect KPrCanvas::objectRect | ( | bool | all | ) | const |
get the rect for the objects
- Parameters:
-
all true if the rect for all objects shoud be returned false if only the rect for selected objects sould be returned
- Returns:
- rect of the objects
Definition at line 5262 of file KPrCanvas.cpp.
void KPrCanvas::alignObjects | ( | AlignType | at | ) |
Align objects.
This will align all selected non protected objects according to the align type at.
- Parameters:
-
at the align type
Definition at line 5464 of file KPrCanvas.cpp.
void KPrCanvas::objectPopup | ( | KPrObject * | object, | |
const QPoint & | point | |||
) |
Open the object popup.
- Parameters:
-
object the selected object point where the popup should be displayed
Definition at line 5617 of file KPrCanvas.cpp.
void KPrCanvas::setPaintGuides | ( | bool | state | ) | [slot] |
Set the guide move state.
- Parameters:
-
state true set guide move state false unset guide move state
Definition at line 5224 of file KPrCanvas.cpp.
void KPrCanvas::stopAutomaticPresentation | ( | ) | [signal] |
Emmitted when presentation should be restarted This is used in automatic screen and infinite loop mode.
void KPrCanvas::restartPresentation | ( | ) | [signal] |
Emmitted when presentation should be restarted This is used in automatic screen and infinite loop mode.
void KPrCanvas::currentObjectEditChanged | ( | ) | [signal] |
Emitted when the current frameset edit changes.
void KPrCanvas::paintEvent | ( | QPaintEvent * | paintEvent | ) | [protected, virtual] |
void KPrCanvas::drawBackground | ( | QPainter * | painter, | |
const QRect & | rect, | |||
KPrPage * | page, | |||
bool | edit = false | |||
) | const [protected] |
Draws the background of page to painter.
Set edit to true if in edit mode, false in presentation mode.
Definition at line 457 of file KPrCanvas.cpp.
void KPrCanvas::drawAllObjectsInPage | ( | QPainter * | painter, | |
const QPtrList< KPrObject > & | obj, | |||
int | pageNum | |||
) | const [protected] |
void KPrCanvas::drawObjectsPres | ( | QPainter * | painter, | |
const QPtrList< KPrObject > & | _objects, | |||
PresStep | step | |||
) | const [protected] |
Draw _objects shown at step to painter.
This method is used for presentation mode, printing.
Definition at line 544 of file KPrCanvas.cpp.
void KPrCanvas::drawObjectsEdit | ( | QPainter * | painter, | |
const KoRect & | rect, | |||
const QPtrList< KPrObject > & | _objects, | |||
SelectionMode | selectionMode, | |||
int | page | |||
) | const [protected] |
Draw _objects to painter.
Only rect is painted. This method is used for edit mode.
Definition at line 574 of file KPrCanvas.cpp.
void KPrCanvas::drawObjects | ( | QPainter * | painter, | |
const QPtrList< KPrObject > & | objects, | |||
SelectionMode | selectionMode, | |||
bool | contour, | |||
KPrTextView * | textView, | |||
int | pageNum | |||
) | const [protected] |
Draw _objects to painter.
contour if true only countor of selected objects is drawn selectionMode selected objects use this selection mode textView if set print editable textobject (used by drawObjectsEdit) This method is used by drawObjectsPres and drawObjectsEdit.
Definition at line 517 of file KPrCanvas.cpp.
void KPrCanvas::drawEditPage | ( | QPainter * | painter, | |
const QRect & | _rect, | |||
KPrPage * | page, | |||
SelectionMode | selectionMode | |||
) | const [protected] |
Draw _objects of page to painter.
This method is used for edit mode.
Definition at line 600 of file KPrCanvas.cpp.
void KPrCanvas::drawPresPage | ( | QPainter * | painter, | |
const QRect & | _rect, | |||
PresStep | step | |||
) | const [protected] |
Draw _objects of page shown at step to painter.
This method is used for presentation mode, printing.
Definition at line 614 of file KPrCanvas.cpp.
void KPrCanvas::drawGrid | ( | QPainter * | painter, | |
const QRect & | rect2 | |||
) | const [protected] |
bool KPrCanvas::finishObjectEffects | ( | ) | [protected] |
Finish the object effects.
This shown the last step of the effect. It stops the effect timer and disconnect it and the effect handler deleted.
Definition at line 3497 of file KPrCanvas.cpp.
KPrObject * KPrCanvas::getObjectAt | ( | const KoPoint & | pos, | |
bool | withoutProtected = false | |||
) | [protected] |
Returns the object at position pos.
- Parameters:
-
pos the position in the document on which to look withoutProtected if set to true only unprotecred objects are returned
- Returns:
- the object at position pos
Definition at line 2234 of file KPrCanvas.cpp.
void KPrCanvas::setupMenus | ( | ) | [protected] |
void KPrCanvas::printPage | ( | QPainter * | painter, | |
PresStep | step, | |||
KPrinter * | printer, | |||
int | rows, | |||
int | cols | |||
) | [protected] |
Draw page defined in step to painter.
This method is used for printing a presentation.
Definition at line 3338 of file KPrCanvas.cpp.
void KPrCanvas::doObjEffects | ( | bool | isAllreadyPainted = false |
) | [protected] |
This method animates the objects in the presentation.
Definition at line 3388 of file KPrCanvas.cpp.
KPrPartObject * KPrCanvas::insertObject | ( | const KoRect & | rect | ) | [protected] |
Add a object.
- Parameters:
-
rect the size and position of the object
Definition at line 3721 of file KPrCanvas.cpp.
void KPrCanvas::insertAutoform | ( | const KoRect & | rect | ) | [protected] |
Add a autoform object.
- Parameters:
-
rect the size and position of the autoform object
Definition at line 3713 of file KPrCanvas.cpp.
void KPrCanvas::drawCubicBezierCurve | ( | QPainter & | p, | |
KoPointArray & | points | |||
) | [protected] |
void KPrCanvas::redrawCubicBezierCurve | ( | QPainter & | p | ) | [protected] |
Redraw the curve defined in m_pointArray.
- Parameters:
-
p painter used for drawing
Definition at line 5098 of file KPrCanvas.cpp.
The documentation for this class was generated from the following files: