PageCtrl Class Reference

#include <pagectrl.h>

List of all members.

Public Slots

void changeSplitMode ()
void changeInputWindow ()
void copy ()
void createHighlighters (int i)
void cut ()
void deleteCurrentHighlighters (int i)
void deletePage ()
void newPage ()
void paste ()
void redo ()
void selectAll ()
void setNewSplitterVisible ()
void undo ()
void retranslateUi ()

Signals

void currentChanged (int i)
 signal page selection changed to i
void cursorAtStartPos ()
 signal cursor has changed inputwindow and is at start position of new window
void cursorModified ()
 signal cursor position modified at current inputwindow
void modified ()
 signal page was modified, used by MainWindow class to update status bar
void pageDeleted (int i)
 signal page i was deleted, used by create highlighters slot

Public Member Functions

 PageCtrl (QWidget *parent=0)
virtual ~PageCtrl ()
QString activeInputWindow ()
int countPages ()
QString currentDeclaration ()
bool currentDeclarationIsVisible ()
QString currentFncType ()
QString currentFileEnd ()
int currentFileExt ()
QString currentFilePath ()
QString currentFileType ()
QString currentFileTypeShort ()
QString currentInstruction ()
QString currentKMHeader ()
QString currentKWProperties ()
QString currentKWDescription ()
QString currentKWWorkSheetName ()
QString currentSiemensDBData ()
int currentTabIndex ()
QString currentPrgLng ()
QString currentSelection ()
QString currentSplitMode ()
int currentSplitSize ()
QString currentTabText ()
QString cursorPosDec ()
QString cursorPosIns ()
QString declarationOf (int index)
void delVARTypeItems ()
QString fncTypeOf (int index)
void fillCurrentDeclaration (QString Str)
void fillCurrentInstruction (QString Str)
QString fileEndOf (int index)
int fileExtOf (int index)
QString tabTextOf (int index)
QString filePathOf (int index)
QString fileTypeOf (int index)
bool find (QString window, QString fStr, QString rStr, QTextDocument::FindFlags options)
void insertText (QString window, QString Str)
void insertTextOf (QString window, QString Str, int index)
QString instructionOf (int index)
QString KMHeaderOf (int index)
QString KWDescriptionOf (int index)
QString KWPropertiesOf (int index)
QString KWWorkSheetNameOf (int index)
QString SiemensDBDataOf (int index)
QString prgLngOf (int index)
void setCurrentDeclarationVisible (bool visible)
void setCurrentFncType (QString Str)
void setCurrentFileEnd (QString Str)
void setCurrentFileExt (QString Str)
void setCurrentFileListItemText (QString Str)
void setCurrentFilePath (QString Str)
void setCurrentFileType (QString Str)
void setCurrentFont (QFont font)
void setCurrentKMHeader (QString Str)
void setCurrentKWDescription (QString Str)
void setCurrentKWProperties (QString Str)
void setCurrentKWWorkSheetName (QString Str)
void setCurrentSiemensDBData (QString Str)
void setCurrentPrgLng (QString Str)
void setCurrentSplitMode (QString Str)
void setCurrentSplitSize (int i)
void setCurrentTypeData (QString filetype, QString functiontype, QString fileendmark)
void setCurrentTabStops (int width)
void setCurrentTabText (QString Str)
void setFileListVisible (bool visible)
void setKWPropertiesOf (int index, QString Str)
void setPrgLngOf (int index, QString Str)
void setSplitModeOf (int index, QString Str)
void setTabCtrlVisible (bool visible)
void setTabPosition (int pos)

Public Attributes

bool flg_fileListVisible
 flag file list visible, used by preferences dialog
bool flg_inhibit_createHighlighters
 flag inhibit create highlighters, used by ImportExport class
bool flg_activate_highlighters
 flag activate highlighters, used by preferences dialog
QFont font
 current application-global font
QString KM_TEXT
 Moeller header copyright string, used by ImportExport class.
QString prgLngStr
 application-global programming language
QString S40_VERSION
 Moeller header compatibility string, used by ImportExport class.
QString splitMode
 application-global split mode for inputwindows
int splitSize
 application-global split size for inputwindows
int tabPosition
 application-global tab position for pages
int tabStopWidth
 application-global tabstop width for inputwindows

Private Slots

void setFileListRow (int i)
void cursorPositionChanged ()

Private Member Functions

QString strippedFileName (const QString &fullFileName)

Private Attributes

bool openInProcess
QListWidget * FileList
 list of opened files
Highlighter_Dechighlighter_dec
 syntax highlighter for declaration section
Highlighter_Inshighlighter_ins
 syntax highlighter for instruction section
QTabWidget * TabCtrl
 QTabwidget instance, holds pages.
QToolButton * delPageButton
 delete pages button, shown in tab row


Constructor & Destructor Documentation

PageCtrl::PageCtrl ( QWidget *  parent = 0  ) 

creating function

PageCtrl::~PageCtrl (  )  [virtual]


Member Function Documentation

QString PageCtrl::activeInputWindow (  ) 

return active inputwindow of current page as short name (Dec, Ins)

void PageCtrl::changeInputWindow (  )  [slot]

toggle focus and cursor for declaratins and Instructions

void PageCtrl::changeSplitMode (  )  [slot]

reversing splitter orientation

void PageCtrl::copy (  )  [slot]

copy from current inputwindow

int PageCtrl::countPages (  ) 

count number of tabs

void PageCtrl::createHighlighters ( int  i  )  [slot]

slot create syntax highlighters of current page

(input variable has no function, only needed for usage as slot)

void PageCtrl::currentChanged ( int  i  )  [signal]

signal page selection changed to i

QString PageCtrl::currentDeclaration (  ) 

return current declaration content

bool PageCtrl::currentDeclarationIsVisible (  ) 

return visibility of current declaration inputwindow

QString PageCtrl::currentFileEnd (  ) 

return current file end

int PageCtrl::currentFileExt (  ) 

return curent file extension

QString PageCtrl::currentFilePath (  ) 

return curent file path (without file name)

QString PageCtrl::currentFileType (  ) 

return current file type

QString PageCtrl::currentFileTypeShort (  ) 

return current file type as short information:

  • nothing set = 'NULL'

  • set but not detectable = 'error'

  • PROGRAM or ORGANIZATION_BLOCK = 'PRG'

  • FUNCTION_BLOCK = 'FB'

  • GLOBAL_VARIABLE_LIST = 'VAR'

QString PageCtrl::currentFncType (  ) 

return current function type

QString PageCtrl::currentInstruction (  ) 

return current instruction content

QString PageCtrl::currentKMHeader (  ) 

QString PageCtrl::currentKWDescription (  ) 

QString PageCtrl::currentKWProperties (  ) 

QString PageCtrl::currentKWWorkSheetName (  ) 

QString PageCtrl::currentPrgLng (  ) 

return programming language of current page

QString PageCtrl::currentSelection (  ) 

return selected text of current input window

QString PageCtrl::currentSiemensDBData (  ) 

QString PageCtrl::currentSplitMode (  ) 

return splitter mode of current page

int PageCtrl::currentSplitSize (  ) 

return splitter size of current page

int PageCtrl::currentTabIndex (  ) 

return current tab/page index

QString PageCtrl::currentTabText (  ) 

return current tab/page text

void PageCtrl::cursorAtStartPos (  )  [signal]

signal cursor has changed inputwindow and is at start position of new window

void PageCtrl::cursorModified (  )  [signal]

signal cursor position modified at current inputwindow

QString PageCtrl::cursorPosDec (  ) 

return cursor position of current declaration inputwindow

QString PageCtrl::cursorPosIns (  ) 

return cursor position of current instruction inputwindow

void PageCtrl::cursorPositionChanged (  )  [private, slot]

slot curosr postion changed, does emit cursor modified signal

void PageCtrl::cut (  )  [slot]

cut from current inputwindow

QString PageCtrl::declarationOf ( int  index  ) 

return declaration content of tab/page index

void PageCtrl::deleteCurrentHighlighters ( int  i  )  [slot]

slot delete syntax highlighters of current page

(input variable has no function, only needed for usage as slot)

void PageCtrl::deletePage (  )  [slot]

delete current page

void PageCtrl::delVARTypeItems (  ) 

delete items which are not used in GLOBAL_VAR lists (instruction inputwindow, moeller header)

QString PageCtrl::fileEndOf ( int  index  ) 

return file end of tab/page index

int PageCtrl::fileExtOf ( int  index  ) 

return file extension of tab/page index

QString PageCtrl::filePathOf ( int  index  ) 

return file path of tab/page index

QString PageCtrl::fileTypeOf ( int  index  ) 

return file type of tab/page index

void PageCtrl::fillCurrentDeclaration ( QString  Str  ) 

clear and fill declaration inputwindow

void PageCtrl::fillCurrentInstruction ( QString  Str  ) 

clear and fill instruction inputwindow

bool PageCtrl::find ( QString  window,
QString  fStr,
QString  rStr,
QTextDocument::FindFlags  options 
)

find given fStr or replace with rStr in window by using QTextDocument::FindFlags

Parameters:
window must be set to 'Dec' or 'Ins'

QString PageCtrl::fncTypeOf ( int  index  ) 

return function type of tab/page index

void PageCtrl::insertText ( QString  window,
QString  Str 
)

insert Str into window

Parameters:
window must be set to 'Dec' or 'Ins'
This function calls the function insertTextOf(QString window, QString Str, int index), by using currentTabIndex() to get the current index. Inputs on 'Ins' windows will be rejected if file type is GLOBAL_VARIABLE_LIST.

void PageCtrl::insertTextOf ( QString  window,
QString  Str,
int  index 
)

insert Str into window on tab/page index

Parameters:
window must be set to 'Dec' or 'Ins'
Inputs on 'Ins' windows will be rejected if file type is GLOBAL_VARIABLE_LIST.

QString PageCtrl::instructionOf ( int  index  ) 

return instruction content of tab/page index

QString PageCtrl::KMHeaderOf ( int  index  ) 

return Moeller header of tab/page index

QString PageCtrl::KWDescriptionOf ( int  index  ) 

return KW-Software description section of tab/page index

QString PageCtrl::KWPropertiesOf ( int  index  ) 

return KW-Software properties section of tab/page index

QString PageCtrl::KWWorkSheetNameOf ( int  index  ) 

return worksheet name of index

void PageCtrl::modified (  )  [signal]

signal page was modified, used by MainWindow class to update status bar

void PageCtrl::newPage (  )  [slot]

create a new page

pages contain a splitter, two inputwindows and some labels for page specific data PLCEdit uses no database to store file specific data. The file specific data are stored into hidden labels on the pages. Only the Splitter and the TextEdits are visible. The content/components of the page can be edited by diverse public functions.

page components:

  • splitter = seperates the QTextEdits, parent is TabCtrl
    • TE1 = contains declarations, parent is splitter
    • TE2 = contains instructions, parent is splitter
    • pageData = contains the following data strings, parent is splitter
      • pd_FilePath = contains path to file without file name, parent is pageData
      • pd_FileExt = contains file extension, parent is pageData
      • pd_FileType = contains POU type mark, parent is pageData
      • pd_FncType = contains type of function, parent is pageData
      • pd_FileEnd = contains POU end mark, parent is pageData
      • pd_PROGLNG = contains programming language of file, parent is pageData
      • pd_KMHeader = contains Moeller Sucosoft header, parent is pageData
      • pd_KWDescription = contains KW-Software description section, parent is pageData
      • pd_KWProperties = contains KW-Software properties section, parent is pageData
      • pd_KWWorkSheetName= contains KW-Software work sheet name, parent is pageData
      • pd_SiemensDBData = contains Siemens DB Data, parent is pageData
      • pd_highlighters = contains highlighter is allowance, parent is pageData

void PageCtrl::pageDeleted ( int  i  )  [signal]

signal page i was deleted, used by create highlighters slot

void PageCtrl::paste (  )  [slot]

paste into current inputwindow

QString PageCtrl::prgLngOf ( int  index  ) 

return programming language of tab/page index

void PageCtrl::redo (  )  [slot]

redo last input on current inputwindow

void PageCtrl::retranslateUi (  )  [slot]

retranslate Ui

void PageCtrl::selectAll (  )  [slot]

select all text in current inputwindow

void PageCtrl::setCurrentDeclarationVisible ( bool  visible  ) 

set visibility of current declaration inputwindow

void PageCtrl::setCurrentFileEnd ( QString  Str  ) 

set file end string of current page

void PageCtrl::setCurrentFileExt ( QString  Str  ) 

set file extension string of current page

void PageCtrl::setCurrentFileListItemText ( QString  Str  ) 

insert FileList item named in Str

void PageCtrl::setCurrentFilePath ( QString  Str  ) 

set file path for current page

void PageCtrl::setCurrentFileType ( QString  Str  ) 

set file type of current page

void PageCtrl::setCurrentFncType ( QString  Str  ) 

set function type of current page

void PageCtrl::setCurrentFont ( QFont  font  ) 

set font of current instruction and declaration inputwindows

void PageCtrl::setCurrentKMHeader ( QString  Str  ) 

set Moeller header for current tab/page

void PageCtrl::setCurrentKWDescription ( QString  Str  ) 

set KW-Software description section for current tab/page

void PageCtrl::setCurrentKWProperties ( QString  Str  ) 

set KW-Software properties section for current tab/page

void PageCtrl::setCurrentKWWorkSheetName ( QString  Str  ) 

set worksheet name for current tab/page

void PageCtrl::setCurrentPrgLng ( QString  Str  ) 

set programming language for current tab/page

void PageCtrl::setCurrentSiemensDBData ( QString  Str  ) 

set Siemens DB Data for current tab/page

void PageCtrl::setCurrentSplitMode ( QString  Str  ) 

set splitter mode of current tab/page

void PageCtrl::setCurrentSplitSize ( int  i  ) 

set split size for current tab/page

void PageCtrl::setCurrentTabStops ( int  width  ) 

set tab width of current instruction and declaration inputwindows

void PageCtrl::setCurrentTabText ( QString  Str  ) 

set tab text of current tab/page

void PageCtrl::setCurrentTypeData ( QString  filetype,
QString  functiontype,
QString  fileendmark 
)

set type of file, type of function, end of file string for current tab/page

void PageCtrl::setFileListRow ( int  i  )  [private, slot]

slot for set FileList row by i

void PageCtrl::setFileListVisible ( bool  visible  ) 

set visibility of FileList

void PageCtrl::setKWPropertiesOf ( int  index,
QString  Str 
)

set KW-Software properties section of index

void PageCtrl::setNewSplitterVisible (  )  [slot]

set visibility of new created page

void PageCtrl::setPrgLngOf ( int  index,
QString  Str 
)

set programming language of index

void PageCtrl::setSplitModeOf ( int  index,
QString  Str 
)

set split mode of index

void PageCtrl::setTabCtrlVisible ( bool  visible  ) 

set visibility of TabCtrl

void PageCtrl::setTabPosition ( int  pos  ) 

set tab orientation by selected postion

Parameters:
pos 1=north, 2=south, 3=east, 4=west, default is north

QString PageCtrl::SiemensDBDataOf ( int  index  ) 

return Siemens DB Data of index

QString PageCtrl::strippedFileName ( const QString &  fullFileName  )  [private]

strip filename from fullFileName (path + filename)

QString PageCtrl::tabTextOf ( int  index  ) 

return tab text == file name of tab/page index

void PageCtrl::undo (  )  [slot]

undo last typing in current inputwindow


Member Data Documentation

QToolButton* PageCtrl::delPageButton [private]

delete pages button, shown in tab row

QListWidget* PageCtrl::FileList [private]

list of opened files

flag activate highlighters, used by preferences dialog

flag file list visible, used by preferences dialog

flag inhibit create highlighters, used by ImportExport class

current application-global font

syntax highlighter for declaration section

syntax highlighter for instruction section

Moeller header copyright string, used by ImportExport class.

bool PageCtrl::openInProcess [private]

application-global programming language

Moeller header compatibility string, used by ImportExport class.

application-global split mode for inputwindows

application-global split size for inputwindows

QTabWidget* PageCtrl::TabCtrl [private]

QTabwidget instance, holds pages.

application-global tab position for pages

application-global tabstop width for inputwindows


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

Generated on Thu Feb 26 19:59:55 2009 for PLCEdit by  doxygen 1.5.8