Scribus
Open source desktop publishing at your fingertips
ScribusMainWindow Class Reference

This Class is the base class for your application. It sets up the main window and providing a menubar, toolbar and statusbar. For the main view, an instance of class ScribusView is created which creates your view. More...

#include <scribus.h>

Inheritance diagram for ScribusMainWindow:
Collaboration diagram for ScribusMainWindow:

Public Slots

void languageChange ()
 
void statusBarLanguageChange ()
 
void specialActionKeyEvent (int unicodevalue)
 
void newView ()
 
void ToggleStickyTools ()
 
void ToggleAllGuides ()
 
void ToggleAllPalettes ()
 
void slotStoryEditor (bool fromTable)
 
void slotCharSelect ()
 
void ImageEffects ()
 
QString fileCollect (const bool compress=false, const bool withFonts=false, const bool withProfiles=false, const QString &newDirectory=QString::null)
 
void AddBookMark (PageItem *ite)
 
void DelBookMark (PageItem *ite)
 
void BookMarkTxT (PageItem *ite)
 
void StoreBookmarks ()
 
void setStatusBarMousePosition (double xp, double yp)
 
void setStatusBarTextPosition (double base, double xp)
 
void setStatusBarTextSelectedItemInfo ()
 
void setTempStatusBarText (const QString &text)
 
void setStatusBarInfoText (QString newText)
 
bool DoFileClose ()
 
void windowsMenuAboutToShow ()
 
void extrasMenuAboutToShow ()
 Handle the Extras menu for its items availability.
 
void newActWin (QMdiSubWindow *w)
 
void closeActiveWindowMasterPageEditor ()
 
void updateActiveWindowCaption (const QString &newCaption)
 
void windowsMenuActivated (int id)
 
void PutScrap (int scID)
 
void PutToInline (QString buffer)
 
void PutToInline ()
 
void PutToPatterns ()
 
void ConvertToSymbol ()
 
void changeLayer (int)
 
void setLayerMenuText (const QString &)
 
void showLayer ()
 
void slotSetCurrentPage (int Seite)
 
void setCurrentPage (int p)
 
void ManageJava ()
 
void editSelectedSymbolStart ()
 
void editSymbolStart (QString temp)
 
void editSymbolEnd ()
 
void editInlineStart (int id)
 
void editInlineEnd ()
 
void editMasterPagesStart (QString temp="")
 
void editMasterPagesEnd ()
 
bool slotFileNew ()
 generate a new document in the current view
 
void newFileFromTemplate ()
 
bool slotPageImport ()
 
bool loadPage (QString fileName, int Nr, bool Mpa, const QString &renamedPageName=QString::null)
 
void GotoLa (int l)
 
void slotGetContent ()
 
void slotGetContent2 ()
 
void slotGetClipboardImage ()
 
void toogleInlineState ()
 
void slotFileAppend ()
 Appends a Textfile to the Text in the selected Textframe at the Cursorposition. More...
 
void removeRecent (QString fn, bool fromFileWatcher=false)
 
void removeRecentFromWatcher (QString filename)
 
void loadRecent (QString filename)
 
void rebuildRecentFileMenu ()
 
void rebuildRecentPasteMenu ()
 
void rebuildScrapbookMenu ()
 
void pasteRecent (QString fn)
 
void pasteFromScrapbook (QString fn)
 
void importVectorFile ()
 
void rebuildLayersList ()
 
bool slotFileOpen ()
 
bool loadDoc (QString)
 
bool postLoadDoc ()
 Do post loading functions.
 
void slotAutoSaved ()
 
bool slotFileSave ()
 save a document
 
bool slotFileSaveAs ()
 save a document under a different filename
 
void slotFileRevert ()
 
void SaveText ()
 Sichert den Text eines Elements.
 
bool slotFileClose ()
 close the actual file
 
void slotFilePrint ()
 print the actual file
 
void slotReallyPrint ()
 
void slotEndSpecialEdit ()
 
bool doPrint (PrintOptions &options, QString &error)
 Generate and print PostScript from a doc. More...
 
void slotFileQuit ()
 exits the application
 
void slotEditCut ()
 put the marked text/object into the clipboard and remove it from the document
 
void slotEditCopy ()
 put the marked text/object into the clipboard
 
void slotEditPaste ()
 paste the clipboard into the document
 
void slotEditCopyContents ()
 
void slotEditPasteContents (int absolute=0)
 
void EnableTxEdit ()
 
void DisableTxEdit ()
 
void SelectAll (bool docWideSelect=false)
 
void SelectAllOnLayer ()
 
void deselectAll ()
 
void ClipChange ()
 
void slotHelpAbout ()
 shows an about dialog
 
void slotHelpAboutPlugins ()
 
void slotHelpAboutQt ()
 
void slotHelpCheckUpdates ()
 
void slotRaiseOnlineHelp ()
 
void slotOnlineHelp (const QString &jumpToSection=QString::null, const QString &jumpToFile=QString::null)
 
void slotOnlineHelpClosed ()
 
void slotResourceManager ()
 
void ToggleTips ()
 
void ToggleMouseTips ()
 
void slotNewPageP (int wo, QString templ)
 Erzeugt eine neue Seite.
 
void slotNewPageM ()
 
void slotNewMasterPage (int w, const QString &)
 
void slotNewPage (int w, const QString &masterPageName=QString::null, bool mov=true)
 
void duplicateToMasterPage ()
 
void deletePage ()
 Loescht die aktuelle Seite.
 
void deletePage (int from, int to)
 Delete pages. More...
 
void deletePage2 (int pg)
 
void movePage ()
 Verschiebt Seiten.
 
void copyPage ()
 
void changePageProperties ()
 
void slotZoom (double zoomFactor)
 Zoom the view. Take the ScMW zoom actions and pass the view a %. Actions have whole number values like 20.0, 100.0, etc. Zoom to Fit uses -100 as a marker. More...
 
void toggleMarks ()
 Schaltet Raender ein/aus.
 
void toggleBleeds ()
 
void toggleFrames ()
 
void toggleLayerMarkers ()
 
void toggleTextLinks ()
 
void toggleTextControls ()
 
void toggleColumnBorders ()
 
void toggleRulers ()
 
void toggleRulerMode ()
 
void togglePagePalette ()
 
void toggleUndoPalette ()
 
void setUndoPalette (bool visible)
 
void toggleCheckPal ()
 
void toggleImageVisibility ()
 Schaltet M_ViewShowImages ein/aus.
 
void toggleGrid ()
 Schaltet Raster ein/aus.
 
void toggleSnapGrid ()
 Schaltet Rasterbenutzung ein/aus.
 
void toggleNodeEdit ()
 Schaltet Rahmenbearbeitung ein/aus.
 
void slotSelect ()
 
void setAppModeByToggle (bool isOn, int newMode)
 Switch appMode. More...
 
void HaveNewDoc ()
 Neues Dokument erzeugt.
 
void HaveNewSel ()
 
void slotDocCh (bool reb=true)
 
void SetNewFont (const QString &nf)
 
void setItemFontSize (int fontSize)
 
void slotReplaceColors ()
 
void MakeFrame (int f, int c, double *vals)
 
void duplicateItem ()
 
void duplicateItemMulti ()
 
void objectAttributes ()
 
void getImageInfo ()
 
void generateTableOfContents ()
 
void updateDocument ()
 
void setNewAlignment (int a)
 
void setNewParStyle (const QString &name)
 
void setNewCharStyle (const QString &name)
 
void setAlignmentValue (int a)
 
void editItemsFromOutlines (PageItem *ite)
 
void selectItemsFromOutlines (PageItem *ite, bool single=false, int position=0)
 
void selectItemFromOutlines (PageItem *ite, bool single, int cPos)
 
void selectPagesFromOutlines (int ScPage)
 
void doPrintPreview ()
 
void printPreview ()
 
void SaveAsEps ()
 
void reallySaveAsEps ()
 
void SaveAsPDF ()
 
void doSaveAsPDF ()
 
void setMainWindowActive ()
 
void setItemEffects (int h)
 
void setStyleEffects (int s)
 
void setItemTypeStyle (int id)
 
void slotElemRead (QString Name, double x, double y, bool art, bool loca, ScribusDoc *docc, ScribusView *vie)
 
void slotChangeUnit (int art, bool draw=true)
 
void ApplyMasterPage ()
 Apply master pages from the Apply Master Page dialog. More...
 
void Apply_MasterPage (QString pageName, int pageNumber, bool reb=true)
 
void GroupObj (bool showLockDia=true)
 
void UnGroupObj ()
 
void AdjustGroupObj ()
 
void StatusPic ()
 
void ModifyAnnot ()
 
void toggleGuides ()
 
void toggleBase ()
 
void toggleSnapGuides ()
 
void toggleSnapElements ()
 
void SetSnapElements (bool b)
 
void EditTabs ()
 
void SearchText ()
 
void imageEditorExited (int, QProcess::ExitStatus)
 
void callImageEditor ()
 call gimp and wait upon completion
 
void docCheckToggle (bool visible)
 
bool scanDocument ()
 Scan a document for errors, return true on errors found.
 
void setUndoMode (bool isObjectSpecific)
 
void insertSampleText ()
 Apply a Lorem Ipsum to the each item in a selection.
 
void updateItemLayerList ()
 
void updateColorLists ()
 
void slotPrefsOrg ()
 Change Preferences dialog. See prefsOrg for more info. It's very similar to docSetup/slotDocSetup.
 
void slotDocSetup ()
 Refromat the document when user click "OK" in ReformDoc dialog. See docSetup() for more info.
 
void slotInsertFrame ()
 Insert a frame friendly dialog.
 
void slotItemTransform ()
 Transform an item.
 
void managePaints ()
 manages paints
 
StyleManagerstyleMgr () const
 allow SE to get the SM for edit stlyes
 

Signals

void TextStyle (const ParagraphStyle &)
 
void TextEffects (int)
 
void UpdateRequest (int updateFlags)
 
void changeLayers (int)
 

Public Member Functions

 ScribusMainWindow ()
 constructor
 
 ~ScribusMainWindow ()
 destructor
 
int initScMW (bool primaryMainwWindow)
 
void addScToolBar (ScToolBar *tb, QString name)
 
bool warningVersion (QWidget *parent)
 
void SetShortCut ()
 
void startUpDialog ()
 
void setDefaultPrinter (const QString &, const QString &, const QString &)
 
void getDefaultPrinter (QString &name, QString &file, QString &command)
 
bool scriptIsRunning (void) const
 
void setScriptRunning (bool value)
 
ScribusDocdoFileNew (double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, const QString &defaultPageSize, bool requiresGUI, int pageCount=1, bool showView=true, int marginPreset=0)
 
ScribusDocnewDoc (double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, const QString &defaultPageSize, bool requiresGUI, int pageCount=1, bool showView=true, int marginPreset=0)
 
bool DoFileSave (const QString &fileName, QString *savedFileName=NULL)
 
void changeEvent (QEvent *e)
 
void closeEvent (QCloseEvent *ce)
 
void keyPressEvent (QKeyEvent *k)
 
void keyReleaseEvent (QKeyEvent *k)
 
void inputMethodEvent (QInputMethodEvent *event)
 
QVariant inputMethodQuery (Qt::InputMethodQuery query) const
 
void requestUpdate (int)
 
void setTBvals (PageItem *currItem)
 
int ShowSubs ()
 
void applyNewMaster (QString name)
 
void updateRecent (QString fn)
 
void doPasteRecent (QString data)
 
bool getPDFDriver (const QString &filename, const QString &name, int components, const std::vector< int > &pageNumbers, const QMap< int, QPixmap > &thumbs, QString &error, bool *cancelled=NULL)
 
bool DoSaveAsEps (QString fn, QString &error)
 
QString CFileDialog (QString workingDirectory=".", QString dialogCaption="", QString fileFilter="", QString defNa="", int optionFlags=fdExistingFiles, bool *useCompression=0, bool *useFonts=0, bool *useProfiles=0)
 
void recalcColors (QProgressBar *dia=0)
 Recalculate the colors after changing CMS settings. Call the appropriate document function and then update the GUI elements. More...
 
void SwitchWin ()
 
void RestoreBookMarks ()
 
QStringList scrapbookNames ()
 
void updateLayerMenu ()
 
void emergencySave ()
 
bool arrowKeyDown ()
 Returns true if an arrow key is pressed down. More...
 
bool isObjectSpecificUndo ()
 Returns true if application is in object specific undo mode, other wise returns false. More...
 
void restore (UndoState *state, bool isUndo)
 Method used when an undo/redo is requested. More...
 
void restoreGrouping (SimpleState *state, bool isUndo)
 
void restoreUngrouping (SimpleState *state, bool isUndo)
 
void restoreAddPage (SimpleState *state, bool isUndo)
 
void restoreDeletePage (SimpleState *state, bool isUndo)
 
void setPreviewToolbar ()
 
void updateGUIAfterPagesChanged ()
 drawnew, call palettes to update for new page layout
 
void updateTableMenuActions ()
 
void emitUpdateRequest (int updateFlags)
 
void slotInsertMark2Mark ()
 
void slotInsertMarkAnchor ()
 
void slotInsertMarkVariableText ()
 
void slotInsertMarkItem ()
 
void slotInsertMarkNote ()
 
void slotInsertMarkIndex ()
 
void slotEditMark ()
 
void slotUpdateMarks ()
 
bool editMarkDlg (Mark *mrk, PageItem_TextFrame *currItem=NULL)
 
void testQTQuick2_1 ()
 
void testQT_slot1 (QString)
 
void testQT_slot2 (double)
 
void testQT_slot3 (int)
 
void testQT_slot4 ()
 
void changePreviewQuality (int index)
 
void enablePalettes (bool b)
 
void ToggleFrameEdit ()
 
void NoFrameEdit ()
 
- Public Member Functions inherited from UndoObject
 UndoObject ()
 Creates a new anonymous UndoObject instance.
 
 UndoObject (const UndoObject &other)
 Creates a copy of an UndoObject instance.
 
 UndoObject (const QString &objectName, QPixmap *objectIcon=0)
 Creates a new UndoObject instance with the name objectName More...
 
virtual ~UndoObject ()
 Destroys the object.
 
virtual QString getUName ()
 Returns the name of the UndoObject. More...
 
virtual void setUName (QString newUName)
 Set the name of the UndoObject. More...
 
virtual QPixmap * getUPixmap ()
 Returns the pixmap connected to this object. More...
 
virtual void setUPixmap (QPixmap *newUPixmap)
 Set the pixmap for this object. More...
 
ulong getUId () const
 Returns an unique identifier number for the UndoObject. More...
 
const ScGuardedPtr< UndoObject > & undoObjectPtr ()
 Returns a guarded pointer.
 

Public Attributes

struct CopyContentsBuffer contentsBuffer
 
bool internalCopy
 
QString internalCopyBuffer
 
int HaveDoc
 
PrefsContextdirs
 
ScribusViewview
 view is the main widget which represents your working area. The View class should handle all events of the view widget. It is kept empty so you can create your view according to your application's needs by changing the view class.
 
ScribusDocdoc
 doc represents your actual document and is created only once. It keeps information such as filename and does the serialization of your files.
 
ScribusDocm_doc
 private doc for managing default patterns.
 
QProgressBar * mainWindowProgressBar
 
ScrSpinBoxzoomSpinBox
 
PageSelectorpageSelector
 
QPushButton * zoomDefaultToolbarButton
 
QPushButton * zoomOutToolbarButton
 
QPushButton * zoomInToolbarButton
 
QComboBox * layerMenu
 
QComboBox * unitSwitcher
 
EditToolBareditToolBar
 
FileToolBarfileToolBar
 
ModeToolBarmodeToolBar
 
PDFToolBarpdfToolBar
 
ViewToolBarviewToolBar
 
QLabel * mainWindowXPosLabel
 
QLabel * mainWindowXPosDataLabel
 
QLabel * mainWindowYPosLabel
 
QLabel * mainWindowYPosDataLabel
 
GuideManagerguidePalette
 
CharSelectcharPalette
 
PropertiesPalettepropertiesPalette
 
MarksManagermarksManager
 
NotesStylesEditornsEditor
 
NodePalettenodePalette
 
OutlinePaletteoutlinePalette
 
BiblioscrapbookPalette
 
LayerPalettelayerPalette
 
PagePalettepagePalette
 
BookPalettebookmarkPalette
 
DownloadsPalettedownloadsPalette
 
SymbolPalettesymbolPalette
 
InlinePaletteinlinePalette
 
MeasurementsmeasurementPalette
 
CheckDocumentdocCheckerPalette
 
UndoPaletteundoPalette
 
AlignDistributePalettealignDistributePalette
 
ResourceManagerresourceManager
 
StoryEditorstoryEditor
 
StoryEditorCurrStED
 
QMdiArea * mdiArea
 
ScribusWinActWin
 
QClipboard * ClipB
 
QString LoadEnc
 
AppModeHelperappModeHelper
 
QProcess * ExternalApp
 
QMap< QString, QPointer< ScrAction > > scrActions
 
QMap< QString, QPointer< ScrAction > > scrRecentFileActions
 
QMap< QString, QPointer< ScrAction > > scrWindowsActions
 
QMap< QString, QPointer< ScrAction > > scrScrapActions
 
QMap< QString, QPointer< ScrAction > > scrLayersActions
 
QMap< QString, QPointer< ScrAction > > scrRecentPasteActions
 
QMap< QString, QPointer< ScToolBar > > scrToolBars
 
QMultiHash< QString, QActionGroup * > scrActionGroups
 
ScMWMenuManagerscrMenuMgr
 
ActionManageractionManager
 
QStringList RecentDocs
 
QStringList patternsDependingOnThis
 

Protected Member Functions

bool eventFilter (QObject *o, QEvent *e)
 Receive key events from palettes such as palette hiding events. Possibly easier way but this is cleaner than before. No need to modify all those palettes and each new one in future.
 
virtual void dragEnterEvent (QDragEnterEvent *e)
 
virtual void dropEvent (QDropEvent *e)
 

Detailed Description

This Class is the base class for your application. It sets up the main window and providing a menubar, toolbar and statusbar. For the main view, an instance of class ScribusView is created which creates your view.

Member Function Documentation

void ScribusMainWindow::ApplyMasterPage ( )
slot

Apply master pages from the Apply Master Page dialog.

Todo:
Make this work with real page numbers, negative numbers and document sections when they are implemented
bool ScribusMainWindow::arrowKeyDown ( )

Returns true if an arrow key is pressed down.

Returns
true if an arrow key is pressed down otherwise returns false
void ScribusMainWindow::deletePage ( int  from,
int  to 
)
slot

Delete pages.

Parameters
fromFirst page to delete
toLast page to delete
bool ScribusMainWindow::doPrint ( PrintOptions options,
QString &  error 
)
slot

Generate and print PostScript from a doc.

Author
Franz Schmid
Parameters
optionsPrintOptions struct to control all settings
errorError Message in case of failure
See also
ScribusMainWindow::slotFilePrint()
Return values
boolTrue for success
void ScribusMainWindow::duplicateItem ( )
slot

Duplicate current item

void ScribusMainWindow::duplicateItemMulti ( )
slot

Multiple duplicate current item

int ScribusMainWindow::initScMW ( bool  primaryMainwWindow)
Return values
0- ok, 1 - no fonts, ...
bool ScribusMainWindow::isObjectSpecificUndo ( )

Returns true if application is in object specific undo mode, other wise returns false.

Returns
true if application is in object specific undo mode, other wise returns false
void ScribusMainWindow::keyPressEvent ( QKeyEvent *  k)

If we have a doc and we are not changing the page or zoom level in the status bar

With no item selected we can:

  • With space, get into panning mode (modePanning)
  • With PageUp, scroll up
  • With PageDown, scroll down
  • With Tab, change active document windowActivated
void ScribusMainWindow::MakeFrame ( int  f,
int  c,
double *  vals 
)
slot

Style Manager Erzeugt einen Rahmen

void ScribusMainWindow::recalcColors ( QProgressBar *  dia = 0)

Recalculate the colors after changing CMS settings. Call the appropriate document function and then update the GUI elements.

Parameters
diaoptional progress widget
void ScribusMainWindow::restore ( UndoState state,
bool  isUndo 
)
virtual

Method used when an undo/redo is requested.

UndoObject must know how to handle the UndoState object given as a parameter. It is the same object that was send from the UndoObject to the UndoManager when the action happened.

Parameters
stateState describing the action that is wanted to be undone/redone
isUndoIf true undo is wanted else if false redo.

Implements UndoObject.

void ScribusMainWindow::setAppModeByToggle ( bool  isOn,
int  newMode 
)
slot

Switch appMode.

Parameters
modeTODO learn modes
void ScribusMainWindow::setItemFontSize ( int  fontSize)
slot

Setz die Zeichensatzgroesse

void ScribusMainWindow::SetNewFont ( const QString &  nf)
slot

Setzt die Abstufung Setzt den Font Korrigiert das FontMenu

void ScribusMainWindow::slotDocCh ( bool  reb = true)
slot

Dokument ist geaendert worden

void ScribusMainWindow::slotFileAppend ( )
slot

Appends a Textfile to the Text in the selected Textframe at the Cursorposition.

Author
Franz Schmid
void ScribusMainWindow::slotNewPageM ( )
slot

Erzeugt eine neue Seite

void ScribusMainWindow::slotReplaceColors ( )
slot

Color Replacement

void ScribusMainWindow::slotSelect ( )
slot

This is the safest method to return to modeNormal

void ScribusMainWindow::slotZoom ( double  zoomFactor)
slot

Zoom the view. Take the ScMW zoom actions and pass the view a %. Actions have whole number values like 20.0, 100.0, etc. Zoom to Fit uses -100 as a marker.

Author
Craig Bradney
Date
Sun 30 Jan 2005
Parameters
zoomFactorValue stored in the ScrAction.
void ScribusMainWindow::updateTableMenuActions ( )

Enables/disables the actions in the "Table" menu.

This has a functions of its own, since it needs to be called from the table edit canvas modes/gestures.


The documentation for this class was generated from the following files: