1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528
|
/***************************************************************************
* copyright : (C) 2003-2014 by Pascal Brachet *
* http://www.xm1math.net/texmaker/ *
* addons by Luis Silvestre *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef TEXMAKER_H
#define TEXMAKER_H
#include <QMainWindow>
#include <QDockWidget>
#include <QMenuBar>
#include <QToolBar>
#include <QListWidget>
#include <QStackedWidget>
#include <QTabWidget>
#include <QTreeWidget>
#include <QListWidget>
#include <QLabel>
#include <QAction>
#include <QActionGroup>
#include <QTreeWidgetItem>
#include <QListWidgetItem>
#include <QTableWidgetItem>
#include <QPointer>
#include <QProcess>
#include <QPushButton>
#include <QColor>
#include <QCompleter>
#include <QTextTable>
#include <QVBoxLayout>
#include <QTableWidget>
#include <QTranslator>
#include <QToolButton>
#include <QTimer>
#include <QKeySequence>
#include "latexeditorview.h"
#include "minisplitter.h"
#include "playerbutton.h"
#include "symbollistwidget.h"
#include "usertagslistwidget.h"
#include "xmltagslistwidget.h"
#include "logeditor.h"
#include "hunspell/hunspell.hxx"
#include "browser.h"
#include "pdfviewerwidget.h"
#include "pdfviewer.h"
#include "sourceview.h"
#include "encodingprober/qencodingprober.h"
#include "scandialog.h"
typedef QMap<LatexEditorView*, QString> FilesMap;
typedef QMap<QString,QString> KeysMap;
typedef QString Userlist[10];
typedef QString UserCd[5];
typedef int SymbolList[412];
class Texmaker : public QMainWindow
{
Q_OBJECT
public:
Texmaker(QWidget *parent = 0);
~Texmaker();
QString getName();
QFont EditorFont;
QByteArray windowstate,splitter1state,splitter2state,splitter3state,fullscreenstate;
void mainWindowActivated();
//virtual QMenu* createPopupMenu();
public slots:
void load( const QString &f );
void setLine( const QString &line );
void ToggleMode();
void insertFromCommandLine(const QString &entity);
void onOtherInstanceMessage(const QString &); // For messages for the single instance
private:
void setupMenus();
void setupToolBars();
void createStatusBar();
bool FileAlreadyOpen(QString f);
void closeEvent(QCloseEvent *e);
int LevelItem(const QTreeWidgetItem *item);
int LineItem(const QTreeWidgetItem *item);
bool currentfileSaved();
bool isCurrentModifiedOutside();
bool copyFile(QString origin,QString destination);
//void removeDir(QDir thedir);
void createBuildSubdirectory(QString fn);
QString outputName(QString finame,QString extension);
QString outputBaseName(QString finame);
bool gtkSession();
void setMasterDocument(const QString &fn);
int untitled_id;
FilesMap filenames;
KeysMap shortcuts, actionstext;
//gui
QFrame *LeftPanelFrameBis, *Outputframe, *separatorline;
MiniSplitter *splitter1, *splitter2, *splitter3 ;
PlayerButton *toggleStructureButton, *toggleLogButton, *togglePdfButton, *toggleSourceButton;
bool embedinternalpdf,winmaximized;
QStackedWidget *EditorView;
QStackedWidget *StackedViewers;
LogEditor* OutputTextEdit;
QStackedWidget *LeftPanelStackedWidget;
QListWidget *OpenedFilesListWidget;
UserTagsListWidget *usertagsListWidget;
XmlTagsListWidget *MpListWidget, *PsListWidget, *leftrightWidget, *tikzWidget, *asyWidget;
SymbolListWidget *RelationListWidget, *ArrowListWidget, *MiscellaneousListWidget, *DelimitersListWidget, *GreekListWidget, *MostUsedListWidget, *FavoriteListWidget;
QTreeWidget *StructureTreeWidget;
QVBoxLayout *OutputLayoutV, *CentralLayoutBis,*LeftPanelLayoutBis;
QHBoxLayout *OutputLayoutH, *LeftPanelLayout, *CentralLayout;
QTableWidget *OutputTableWidget;
//menu-toolbar
QMenu *fileMenu, *recentMenu, *editMenu, *toolMenu, *sessionMenu;
QMenu *latex1Menu, *latex11Menu, *latex12Menu, *latex13Menu, *latex14Menu, *latex15Menu, *latex16Menu, *latex17Menu, *latex18Menu ;
QMenu *math1Menu, *math11Menu, *math12Menu, *math13Menu, *math14Menu;
QMenu *wizardMenu;
QMenu *bibMenu, *bibtexMenu, *biblatexMenu;
QMenu *user1Menu, *user11Menu, *user12Menu;
QMenu *viewMenu;
QMenu *optionsMenu, *translationMenu, *appearanceMenu, *settingsMenu;
QMenu *helpMenu;
QMenu *sectionMenu, *sizeMenu, *refMenu;
QToolBar *fileToolBar, *editToolBar, *runToolBar, /* *formatToolBar ,*/ *logToolBar, *LeftPanelToolBar,*LeftPanelToolBarBis, *centralToolBar, *centralToolBarBis;
QAction *recentFileActs[10], *ToggleAct, *StopAct, *UndoAct, *RedoAct, *SaveAct, *CutAct, *CopyAct,*PasteAct, *ToggleDocAct, *ViewStructurePanelAct, *ViewLogPanelAct, *ViewPdfPanelAct, *ViewSourcePanelAct, *FullScreenAct, *NextDocAct, *PrevDocAct, *ViewOpenedFilesPanelAct ;
QAction *relationAct, *arrowAct, *miscAct, *delimAct, *greekAct, *usedAct, *favAct, *leftrightAct, *pstricksAct, *mpAct, *tikzAct, *asyAct, *userpanelAct;
bool showPstricks, showMp, showTikz, showAsy;
QAction *viewPstricksAct, *viewMpAct, *viewTikzAct, *viewAsyAct;
QAction *emphasisAct, *newlineAct, *mathmodeAct, *indiceAct, *puissanceAct, *smallfracAct, *dfracAct, *racineAct;
QAction *showemphasisAct, *shownewlineAct, *showmathmodeAct, *showindiceAct, *showpuissanceAct, *showsmallfracAct, *showdfracAct, *showracineAct;
bool showEmphasis, showNewline, showMathmode, showIndice, showPuissance, showSmallfrac, showDfrac, showRacine;
QComboBox *comboCompil, *comboView, *comboFiles;
QLabel *stat1, *stat2, *stat3, *titleLeftPanel, *posLabel;
QPushButton *pb1, *pb2, *pb3;
QString MasterName;
bool logpresent;
QStringList recentFilesList;
QString sessionTempFile;
//settings
bool eraseSettings, replaceSettings;
QString settingsFileName;
int split1_right, split1_left, split2_top, split2_bottom, quickmode, tabwidth;
bool singlemode, wordwrap, parenmatch, showline, showoutputview, showstructview, showpdfview, showsourceview, showfilesview, ams_packages, makeidx_package, completion, inlinespellcheck, modern_style, new_gui, builtinpdfview, singleviewerinstance, babel_package, geometry_package, graphicx_package, watchfiles, autosave, tabspaces, useoutputdir ;
bool lmodern_package, kpfonts_package, fourier_package;
QString document_class, typeface_size, paper_size, document_encoding, author, geometry_options, babel_default;
QString latex_command, viewdvi_command, dvips_command, dvipdf_command, metapost_command, psize, xelatex_command, lualatex_command, htlatex_command, htlatex_options;
QString viewps_command, ps2pdf_command, makeindex_command, bibtex_command, pdflatex_command, viewpdf_command, userquick_command, ghostscript_command, asymptote_command, latexmk_command, sweave_command, texdoc_command, quick_asy_command, lp_options;
QString spell_dic, spell_ignored_words;
QString lastDocument, input_encoding, lastChild, lastTemplate, lastScript;
QString struct_level1, struct_level2, struct_level3, struct_level4, struct_level5;
QStringList userClassList, userPaperList, userEncodingList, userOptionsList, userCompletionList, userBabelList;
QStringList labelitem, bibitem, listbibfiles, listchildfiles;
Userlist UserMenuName, UserMenuTag;
UserCd UserToolName, UserToolCommand;
QString keyToggleFocus;
QString extra_path;
QString beamer_theme, beamer_size, beamer_encoding, beamer_author, beamer_babel;
qreal lastScale;
bool clean_exit;
//dialogs
QPointer<ScanDialog> scanDialog;
QPointer<Browser> browserWindow, diffWindow;
QPointer<PdfViewerWidget> pdfviewerWidget;
QPointer<PdfViewer> pdfviewerWindow;
SourceView* sourceviewerWidget;
//tools
QProcess *proc;
bool FINPROCESS, ERRPROCESS, STOPPROCESS;
QStringList listViewerCommands;
bool checkViewerInstance;
//latex errors
QStringList errorFileList, errorTypeList, errorLineList, errorMessageList, errorLogList;
QList<int> onlyErrorList;
int errorIndex, runIndex, viewIndex;
QString pdfCheckerLang;
//X11
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
QString x11style;
QString x11fontfamily;
int x11fontsize;
#endif
SymbolList symbolScore;
usercodelist symbolMostused;
QList<int> favoriteSymbolList;
QStringList userTagsList;
QColor colorBackground, colorLine, colorHighlight, colorStandard, colorComment, colorMath, colorCommand, colorKeyword, colorVerbatim, colorTodo, colorKeywordGraphic, colorNumberGraphic;
QList<QColor> edcolors() {QList<QColor> e; e << colorBackground << colorLine << colorHighlight << colorStandard; return e;}
QList<QColor> hicolors() {QList<QColor> h; h << colorStandard << colorComment << colorMath << colorCommand << colorKeyword << colorVerbatim << colorTodo << colorKeywordGraphic << colorNumberGraphic; return h;}
QCompleter *completer;
Hunspell * spellChecker;
bool spelldicExist();
QStringList translationList;
QActionGroup *translationGroup, *appearanceGroup;
QTimer *autosaveTimer;
private slots:
LatexEditorView *currentEditorView() const;
void fileNew();
void fileNewFromFile();
void fileOpen();
void checkModifiedOutsideAll();
void fileSave();
void fileSaveAll();
void fileBackupAll();
void fileSaveAs();
void fileSaveACopy();
void fileClose();
void fileCloseRequested( int index);
void fileCloseAll();
void fileExit();
void fileOpenRecent();
void AddRecentFile(const QString &f);
void UpdateRecentFile();
void CleanRecent();
void filePrint();
void fileOpenAndGoto(const QString &f, int line, bool focus);
void getFocusToEditor();
void fileReload();
void allReload();
void listSelectionActivated(int index);
void ComboFilesInsert(const QString & file);
void ToggleMasterCurrent();
void editUndo();
void editRedo();
void editCut();
void editCopy();
void editPaste();
void editSelectAll();
void editFind();
void editFindNext();
void editFindInDirectory();
void editReplace();
void editGotoLine();
void editComment();
void editUncomment();
void editIndent();
void editUnindent();
void editSpell();
void editTipTab();
void editRunScript();
void ReadSettings();
void SaveSettings();
void DeleteSettings();
void CopySettings();
void ReplaceSettings();
void setPrintPaperSize(const QString &p);
void NewDocumentStatus(bool m);
void UpdateCaption();
void UpdateStructure();
void UpdateChildsLabels(QStringList listfiles);
void UpdateBibliography();
void ParseTree(QTreeWidgetItem *item);
void ItemToRange(QTreeWidgetItem *item);
void ShowOpenedFiles();
void OpenedFileActivated(QListWidgetItem *item);
void ShowStructure();
void ShowRelation(); //RelationListWidget
void ShowArrow(); //ArrowListWidget
void ShowMisc(); //MiscellaneousListWidget
void ShowDelim(); //DelimitersListWidget
void ShowGreek(); //GreekListWidget
void ShowMostUsed(); //MostUsedListWidget
void ShowFavorite(); //FavoriteListWidget
void ShowPstricks(); //PsListWidget
void ShowLeftRight(); //leftrightWidget
void ShowMplist(); //MpListWidget
void ShowTikz(); //tikzWidget
void ShowAsy(); //asyWidget
void ShowUserPanel(); //userPanel
void ClickedOnStructure(QTreeWidgetItem *item,int);
void InsertTag(QString Entity, int dx, int dy);
void InsertSymbol(QTableWidgetItem *item);
void InsertXmlTag(QListWidgetItem *item);
void InsertUserElement(QListWidgetItem *item);
void InsertFromAction();
void InsertWithSelectionFromAction();
void InsertWithSelectionFromString(const QString& text);
void InsertFromString(const QString& text);
void InsertBib();
void InsertBibLatex();
void InsertStruct();
void InsertStructFromString(const QString& text);
void InsertImage();
void InsertInclude();
void InsertInput();
void InsertBib1();
void InsertBib2();
void InsertBib3();
void InsertBib4();
void InsertBib5();
void InsertBib6();
void InsertBib7();
void InsertBib8();
void InsertBib9();
void InsertBib10();
void InsertBib11();
void InsertBib12();
void InsertBib13();
void InsertBibLatex1(); //Article in Journal
void InsertBibLatex2(); //Single-volume book
void InsertBibLatex3(); //Multi-volume book
void InsertBibLatex4(); //Part of a book
void InsertBibLatex5(); //Booklet
void InsertBibLatex6(); //Single-volume collection
void InsertBibLatex7(); //Multi-volume collection
void InsertBibLatex8(); //Part of a collection
void InsertBibLatex9(); //Technical documentation
void InsertBibLatex10(); //Miscellaneous
void InsertBibLatex11(); //Online resource
void InsertBibLatex12(); //Issue of a periodical
void InsertBibLatex13(); //Single-volume conference proceedings
void InsertBibLatex14(); //Multi-volume conference proceedings
void InsertBibLatex15(); //Article in conference proceedings
void InsertBibLatex16(); //Technical report
void InsertBibLatex17(); //Thesis
void InsertBibLatex18(); //Patent
void CleanBib();
void InsertUserTag(QString Entity);
void InsertUserTag1();
void InsertUserTag2();
void InsertUserTag3();
void InsertUserTag4();
void InsertUserTag5();
void InsertUserTag6();
void InsertUserTag7();
void InsertUserTag8();
void InsertUserTag9();
void InsertUserTag10();
void EditUserMenu();
void SectionCommand();
void OtherCommand();
void InsertCite();
void InsertRef();
void InsertPageRef();
void SizeCommand();
void ShowSectionMenu();
void ShowRefMenu();
void ShowSizeMenu();
void QuickTabular();
void QuickArray();
void QuickTabbing();
void QuickLetter();
void QuickDocument();
void QuickBeamer();
void RunCommand(QString comd,bool waitendprocess);
void readFromStderr();
void stopProcess();
void readFromStdoutput();
void SlotEndProcess(int err);
void SlotEndViewerProcess(int err);
void QuickBuild();
void Latex();
void ViewDvi();
void DviToPS();
void ViewPS();
void PDFLatex();
void ViewPDF();
void CleanAll();
void AutoCleanAll();
void MakeBib();
void MakeIndex();
void PStoPDF();
void DVItoPDF();
void MetaPost();
void Asymptote();
void LatexMk();
void Sweave();
void Xelatex();
void Lualatex();
void AsyFile(QString asyfile);
void UserTool1();
void UserTool2();
void UserTool3();
void UserTool4();
void UserTool5();
void EditUserTool();
void doCompile();
void doView();
void jumpToPdfline(int line);
void OpenTerminal();
void Export();
void ConvertToUnicode();
void LoadLog();
void ViewLog();
void ClickedOnOutput(int l);
void ClickedOnLogLine(QTableWidgetItem *item);
void LatexError();
void DisplayLatexError();
void NextError();
void PreviousError();
bool NoLatexErrors();
bool LogExists();
/////
void LatexHelp();
void UserManualHelp();
void TexDocHelp();
void HelpAbout();
void CheckVersion();
void Doculatex();
void Docufrlatex();
void GeneralOptions();
void gotoNextDocument();
void gotoPrevDocument();
void SetInterfaceFont();
void gotoBookmark1();
void gotoBookmark2();
void gotoBookmark3();
void SetMostUsedSymbols();
void InsertFavoriteSymbols();
void RemoveFavoriteSymbols();
void RemoveUserTag();
void AddUserTag();
void ChangeUserTag();
void UpdateUserTag();
void ModifyShortcuts();
void initCompleter();
void updateCompleter();
void updateTranslation();
void updateAppearance();
void disableToolsActions();
void enableToolsActions();
void clipboardDataChanged();
void refreshAll();
void refreshAllFromCursor(int newnumlines);
void refreshRange();
void jumpToStructure(int line);
void ToggleStructurePanel();
void ToggleLogPanel();
void TogglePdfPanel();
void ToggleSourcePanel();
void ToggleFilesPanel();
void ShowStructView(bool change);
void ShowOutputView(bool change);
void ShowPdfView(bool change);
void ShowSourceView(bool change);
void ShowFilesView(bool change);
void ToggleFullScreen();
void EditUserCompletion();
void addBibFiles(QString param);
void addIncludeFiles(QString param);
void loadIncludeFiles(QString param, QString extension);
void showCursorPos(int li, int col);
void customContentsMenuStructure( const QPoint &pos );
void customContentsMenuMain( const QPoint &pos );
void TogglePstricks();
void ToggleMetapost();
void ToggleTikz();
void ToggleAsymptote();
void ToggleEmphasis();
void ToggleNewline();
void ToggleMathmode();
void ToggleIndice();
void TogglePuissance();
void ToggleSmallfrac();
void ToggleDfrac();
void ToggleRacine();
void splitter2Changed();
void SaveSession();
void LoadSessionFile(const QString &fn);
void LoadSession();
void SaveLastSession();
void LoadLastSession();
void compareDocuments();
protected:
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent *event);
void keyPressEvent(QKeyEvent * event);
};
#endif
|