/**
 * @file mainwindow.h
 * @brief Declares the MainWindow class, the primary interface for the SocNetV application.
 * @author Dimitris B. Kalamaras (http://dimitris.apeiro.gr)
 * @copyright
 *   Copyright (C) 2005-2026 by Dimitris B. Kalamaras.
 *   This file is part of SocNetV (Social Network Visualizer).
 * @license
 *   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, version 3 or later.
 *   For more details, see <http://www.gnu.org/licenses/>.
 * @see https://socnetv.org
 */


#ifndef MAINWINDOW_H
#define MAINWINDOW_H

/** \file mainwindow.h

 \brief Documentation for the mainwindow file.

*/

#include <QMainWindow>
#include <QPrinter>
#include <QMessageBox>
#include <QScrollArea>
#include <QStack>
#include <QThread>
#include <QNetworkReply>

// Allows to use QT_CHARTS namespace directives (see below)
#include <QtCharts/QChartGlobal>

#include "global.h"
#include "graph/filters/filter_condition.h"

QT_BEGIN_NAMESPACE
class QGraphicsScene;
class QMenu;
class QAction;
class QCheckBox;
class QProgressDialog;
class QPushButton;
class QToolButton;
class QPageSize;
class QSlider;
class QComboBox;
class QGroupBox;
class QTabWidget;
class QSpinBox;
class QNetworkAccessManager;
class QSslError;
class QString;
class QAbstractSeries;
class QAbstractAxis;
class QTextCodec;
class QUrl;
QT_END_NAMESPACE

using namespace std;

SOCNETV_USE_NAMESPACE
class Graph;
class GraphicsWidget;
class GraphicsEdge;
class GraphicsNode;
class Chart;
class DialogPreviewFile;
class DialogWebCrawler;
class DialogDataSetSelect;
class DialogRandErdosRenyi;
class DialogRandSmallWorld;
class DialogRandScaleFree;
class DialogRandRegular;
class DialogRandLattice;
class DialogSimilarityPearson;
class DialogSimilarityMatches;
class DialogDissimilarities;
class DialogClusteringHierarchical;
class DialogExportPDF;
class DialogExportImage;
class DialogNodeFind;
class DialogNodeEdit;
class DialogEdgeEdit;
class DialogBulkEdit;
class DialogFilterNodesByCentrality;
class DialogFilterEdgesByWeight;
class DialogQueryBuilder;
class DialogEdgeDichotomization;
class DialogSettings;
class DialogSystemInfo;
class TextEditor;
class FilterBarWidget;
class GraphTableWidget;
class QDockWidget;

typedef QHash <QString, int> H_StrToInt;


/**
  \brief The base window of SocNetV contains all widgets and functionality.

    It sets up the main window and provides a menubar, toolbar and statusbar.
    For the main view, an instance of class GraphicsWidget is
    created which creates a graphics widget.
 */

class MainWindow : public QMainWindow
{
    Q_OBJECT

    QThread graphThread;

public:

    MainWindow(const QString &m_fileName=QString(), const bool &forceProgress=false, const bool &maximized=false, const bool &fullscreen=false, const int &debugLevel=0);
    ~MainWindow();

    void slotOptionsCustomStylesheet(const bool checked);
    void slotStyleSheetByName(const QString &sheetFileName);

    void polishProgressDialog(QProgressDialog* dialog);

    void initGraph();
    void terminateThreads(const QString &reason);
    void initView();
    void initActions();
    void initMenuBar();
    void initToolBar();
    void initPanels();
    void initWindowLayout();
    void initSignalSlots();
    QMap<QString, QString> initSettings(const int &debugLevel=0, const bool &forceProgress=false);
    void initNetworkAvailableTextCodecs();
    void saveSettings();

    void initApp();

    void initComboBoxes();

    void setLastPath(const QString &filePath);
    QString getLastPath();
    void createFortuneCookies();

    int activeEdges();
    int activeNodes();

public slots:
    //NETWORK MENU
    void slotNetworkNew();
    void slotNetworkFileChoose(QString m_fileName = QString(),
                               int fileFormat = -1,
                               const bool &checkSelectFileType = true);
    void slotNetworkFileDialogFileSelected(const QString &fileName);
    void slotNetworkFileDialogFilterSelected(const QString &filter);
    void slotNetworkFileDialogRejected();
    void slotNetworkFileRecentUpdateActions();
    bool slotNetworkFilePreview(const QString &, const int &);
    void slotNetworkFileLoad (const QString &fileNameToLoad, const QString &codeName, const int &fileFormat);
    void slotNetworkFileLoaded(const int &type,
                               const QString &fName=QString(),
                               const QString &netName=QString(),
                               const int &totalNodes=0,
                               const int &totalEdges=0,
                               const qreal &density=0,
                               const qint64 &elapsedTime=0,
                               const QString &message=QString());
    void slotNetworkFileLoadRecent();
    void slotNetworkSavedStatus(const int &status);
    void slotNetworkFileView();
    void slotNetworkImportGraphML();
    void slotNetworkImportPajek();
    void slotNetworkImportAdjacency();
    void slotNetworkImportGraphviz();
    void slotNetworkImportGML();
    void slotNetworkImportUcinet();
    void slotNetworkImportEdgeList();
    void slotNetworkImportTwoModeSM();

    void slotNetworkChanged(const bool &directed,
                            const int &vertices, const int &edges,
                            const qreal &density,
                            const bool &needsSaving=true);
    void slotNetworkSave(const int &fileFormat=-1);
    void slotNetworkSaveAs();
    bool slotNetworkClose();
    void slotNetworkPrint();
    void slotNetworkViewSociomatrix();
    void slotNetworkViewSociomatrixPlotText();

    void slotNetworkExportImageDialog();
    void slotNetworkExportImage ( const QString &filename,
                                  const QByteArray &format,
                                  const int &quality,
                                  const int &compression
                                  );

    void slotNetworkExportPDFDialog();
    void slotNetworkExportPDF(QString &pdfName,
                              const QPageLayout::Orientation &orientation,
                              const int &dpi,
                              const QPrinter::PrinterMode printerMode,
                              const QPageSize &pageSize);
    void slotNetworkExportPajek();
    void slotNetworkExportSM();
    void slotNetworkExportDot();
    bool slotNetworkExportDL();
    bool slotNetworkExportGW();
    bool slotNetworkExportList();
    void slotNetworkExportNodesCSV();
    void slotNetworkExportEdgesCSV();
    void slotNetworkExportNodesJSON();
    void slotNetworkExportEdgesJSON();
    void slotNetworkTextEditor();
    void slotNetworkDataSetSelect();
    void slotNetworkDataSetRecreate(const QString);

    void slotNetworkRandomErdosRenyiDialog();
    void slotNetworkRandomErdosRenyi( const int N,
                                      const QString model,
                                      const int edges,
                                      const qreal eprob,
                                      const QString mode,
                                      const bool diag) ;
    void slotNetworkRandomRegularDialog();
    void slotNetworkRandomRegular(const int &newNodes, const int &degree,
                                  const QString &mode, const bool &diag);

    void slotNetworkRandomGaussian();

    void slotNetworkRandomScaleFreeDialog();

    void slotNetworkRandomScaleFree(const int &newNodes,
                                    const int &power,
                                    const int &initialNodes,
                                    const int &edgesPerStep,
                                    const qreal &zeroAppeal,
                                    const QString &mode);

    void slotNetworkRandomSmallWorldDialog();

    void slotNetworkRandomSmallWorld  (const int &newNodes,
                                       const int &degree,
                                       const qreal &beta,
                                       const QString &mode,
                                       const bool &diag);

    void slotNetworkRandomRingLattice();

    void slotNetworkRandomLatticeDialog();
    void slotNetworkRandomLattice(const int &newNodes,
                                  const int &length,
                                  const int &dimension,
                                  const int &nei,
                                  const QString &mode,
                                  const bool &circular);

    void slotNetworkWebCrawlerDialog();

    void slotNetworkWebCrawler(const QUrl &startUrl,
                               const QStringList &urlPatternsIncluded,
                               const QStringList &urlPatternsExcluded,
                               const QStringList &linkClasses,
                               const int &maxNodes,
                               const int &maxLinksPerPage,
                               const bool &intLinks,
                               const bool &childLinks,
                               const bool &parentLinks,
                               const bool &selfLinks,
                               const bool &extLinks,
                               const bool &extLinksCrawl,
                               const bool &socialLinks,
                               const bool &delayedRequests);

    void slotNetworkManagerRequest(const QUrl &url, const NetworkRequestType &requestType);


    //EDIT MENU
    void slotEditDragModeSelection(bool);
    void slotEditDragModeScroll(bool);

    void slotEditRelationsClear();

    void slotEditRelationAddPrompt();

    void slotEditRelationAdd(const QString &newRelationName);
    void slotEditRelationChange(const int &relIndex=RAND_MAX);
    void slotEditRelationRename();

    void slotEditOpenContextMenu(const QPointF & mPos);
    void slotEditSelectionChanged (const int &selNodes, const int &selEdges);

    void slotEditNodeSelectAll();
    void slotEditNodeSelectNone();
    void slotEditNodeInfoStatusBar(const int &number,
                                   const QPointF &p,
                                   const QString &label,
                                   const int &inDegree,
                                   const int &outDegree);
    void slotEditNodePosition(const int &nodeNumber, const int &x, const int &y);
    void slotEditNodeAdd();

    void slotEditNodeFindDialog();
    void slotEditNodeFind(const QStringList &nodeList,
                          const QString &searchType,
                          const QString &indexStr=QString());
    void slotEditNodeRemove();
    void slotEditNodeOpenContextMenu();
    void slotEditNodePropertiesDialog();
    void slotCacheSelection(const QList<int> &nodes, const QList<SelectedEdge> &edges);
    void slotEditNodeEditSelectionInTable();
    void slotEditNodeSetPropertyForSelection();
    void slotEditEdgeSetPropertyForSelection();
    void slotEditNodeProperties( const QString &label,
                                 const int &size,
                                 const QColor &color,
                                 const QString &shape,
                                 const QString &iconPath,
                                 const QHash<QString, QString> &customAttributes
                                 );
    void slotEditNodeSelectedToClique();
    void slotEditNodeSelectedToStar();
    void slotEditNodeSelectedToCycle();
    void slotEditNodeSelectedToLine();
    void slotEditNodeColorAll(QColor color=QColor());
    void slotEditNodeSizeAll(int newSize=0, const bool &normalized=false);
    void slotEditNodeShape(const int &vertex = 0,
                           QString shape=QString(),
                           QString nodeIconPath=QString());
    void slotEditNodeNumberSize(int v1=0, int newSize=0, const bool prompt=true);
    void slotEditNodeNumberDistance(int v1=0, int newSize=0);
    void slotEditNodeNumbersColor(const int &v1=0, QColor color=QColor());
    void slotEditNodeLabelSize(const int v1=0, int newSize=0);
    void slotEditNodeLabelsColor(QColor color=QColor());
    void slotEditNodeLabelDistance(int v1=0, int newSize=0);

    void slotEditEdgeClicked (const MyEdge &edge=MyEdge(),
                              const bool &openMenu=false);

    void slotEditEdgeOpenContextMenu(const QString &str="") ;
    void slotEditEdgeAdd();
    void slotEditEdgeCreate (const int &source, const int &target,
                             const qreal &weight=1);
    void slotEditEdgeRemove();
    void slotEditEdgePropertiesDialog();
    void slotEditEdgeProperties(const int &v1,
                                const int &v2,
                                const QString &label,
                                const double &weight,
                                const QColor &color,
                                const QHash<QString,QString> &customAttributes);
    void slotEditEdgeLabel();
    void slotEditEdgeColor();
    void slotEditEdgeWeight();
    void slotEditEdgeColorAll(QColor color=QColor(), const int threshold=RAND_MAX);

    void slotEditEdgeMode(const int &mode);
    void slotEditGraphDirectedChanged(const bool &directed);
    void slotEditEdgeSymmetrizeAll();
    void slotEditEdgeSymmetrizeStrongTies();
    void slotEditEdgeSymmetrizeCocitation();
    void slotEditEdgeUndirectedAll(const bool &toggle);

    void slotEditEdgeDichotomizationDialog();
    void slotEditEdgeDichotomization(const qreal threshold);

    void slotFilterNodesDialogByCentrality();
    void slotEditFilterNodesIsolates(bool checked);
    void slotFilterNodesByEgoNetwork();
    void slotFilterNodesBySelection();
    void slotFilterNodesByAttribute();
    void slotFilterByQueryBuilder();
    void slotFilterNodesRestoreAll();
    void slotEditFilterEdgesByWeightDialog();
    void slotEditFilterEdgesReset();
    void slotEditFilterEdgesUnilateral(bool checked);

    void slotEditSubgraphExtract();
    void slotEditSubgraphExtractFromSelection();
    void saveSubgraphToFile(Graph *sub, const QString &subgraphName);

    void slotEditTransformNodes2Edges();


    // LAYOUT MENU
    void slotLayoutRandom();
    void slotLayoutRadialRandom();
    void slotLayoutEgoRadial();

    void slotLayoutRadialByProminenceIndex();
    void slotLayoutRadialByProminenceIndex(QString prominenceIndexName);

    void slotLayoutLevelByProminenceIndex();
    void slotLayoutLevelByProminenceIndex(QString prominenceIndexName);

    void slotLayoutNodeSizeByProminenceIndex();
    void slotLayoutNodeSizeByProminenceIndex(QString prominenceIndexName);

    void slotLayoutNodeColorByProminenceIndex();
    void slotLayoutNodeColorByProminenceIndex(QString prominenceIndexName);
    void slotLayoutNodeColorByComponent();

    void slotLayoutSpringEmbedder();
    void slotLayoutFruchterman();
    void slotLayoutKamadaKawai();

    void slotLayoutColorationStrongStructural();
    void slotLayoutColorationRegular();

    void slotLayoutGuides(const bool &toggle);

    //ANALYSIS MENU
    void askAboutEdgeWeights(const bool userTriggered=false);

    void slotAnalyzeReciprocity();
    void slotAnalyzeSymmetryCheck();
    void slotAnalyzeMatrixAdjacencyInverse();
    void slotAnalyzeMatrixAdjacencyTranspose();
    void slotAnalyzeMatrixAdjacencyCocitation();
    void slotAnalyzeMatrixDegree();
    void slotAnalyzeMatrixLaplacian();
    void slotAnalyzeClusteringCoefficient();

    void slotAnalyzeMatrixDistances();
    void slotAnalyzeMatrixGeodesics();
    void slotAnalyzeDistance();
    void slotAnalyzeDistanceAverage();
    void slotAnalyzeDiameter();
    void slotAnalyzeEccentricity();

    void slotAnalyzeWalksLength();
    void slotAnalyzeWalksTotal();
    void slotAnalyzeReachabilityMatrix();
    void slotAnalyzeConnectedness();

    void slotAnalyzeCentralityDegree();
    void slotAnalyzeCentralityCloseness();
    void slotAnalyzeCentralityClosenessIR();
    void slotAnalyzeCentralityBetweenness();
    void slotAnalyzeCentralityInformation();
    void slotAnalyzeCentralityEigenvector();
    void slotAnalyzeCentralityStress();
    void slotAnalyzeCentralityPower();
    void slotAnalyzeCentralityEccentricity();

    void slotAnalyzePrestigeDegree();
    void slotAnalyzePrestigePageRank();
    void slotAnalyzePrestigeProximity();

    void slotAnalyzeProminenceDistributionChartUpdate(QAbstractSeries *series,
                                                      QAbstractAxis *axisX,
                                                      const qreal &min,
                                                      const qreal &max,
                                                      QAbstractAxis *axisY=Q_NULLPTR,
                                                      const qreal &minF=0,
                                                      const qreal &maxF=0
            );

    void slotAnalyzeCommunitiesCliqueCensus();
    void slotAnalyzeCommunitiesTriadCensus();

    void slotAnalyzeStrEquivalenceClusteringHierarchicalDialog();
    void slotAnalyzeStrEquivalenceClusteringHierarchical(const QString &matrix,
                                                         const QString &varLocation,
                                                         const QString &metric,
                                                         const QString &method,
                                                         const bool &diagonal=false,
                                                         const bool &diagram=false);

    void slotAnalyzeStrEquivalenceDissimilaritiesDialog();
    void slotAnalyzeStrEquivalenceDissimilaritiesTieProfile(const QString &metric,
                                                            const QString &varLocation,
                                                            const bool &diagonal);

    void slotAnalyzeStrEquivalenceSimilarityMeasureDialog();
    void slotAnalyzeStrEquivalenceSimilarityByMeasure(const QString &matrix,
                                                      const QString &varLocation,
                                                      const QString &measure,
                                                      const bool &diagonal);

    void slotAnalyzeStrEquivalencePearsonDialog();
    void slotAnalyzeStrEquivalencePearson(const QString &matrix,
                                          const QString &varLocation,
                                          const bool &diagonal=false);



    //OPTIONS MENU
    void slotOpenSettingsDialog();
    void slotOptionsNodeNumbersVisibility(bool toggle);
    void slotOptionsNodeNumbersInside(bool toggle);
    void slotOptionsNodeLabelsVisibility(bool toggle);
    void slotOptionsEdgesVisibility(bool toggle);
    void slotOptionsEdgeOffsetFromNode(const int &offset,
                                       const int &v1=0,
                                       const int &v2=0);
    void slotOptionsEdgeLabelsVisibility(bool toggle);
    void slotOptionsEdgeWeightNumbersVisibility(bool toggle);
    void slotOptionsEdgeWeightsDuringComputation(bool);
    void slotOptionsEdgeThicknessPerWeight(bool toggle);
    void slotOptionsEdgesBezier(bool toggle);
    void slotOptionsEdgeArrowsVisibility(bool toggle);
    void slotOptionsEdgeArrowSize(const int &size);

    void slotOptionsSaveZeroWeightEdges(bool toggle);
    void slotOptionsShowZeroWeightEdges(bool toggle);  // #30

    void slotOptionsEmbedLogoExporting(bool toggle);
    void slotOptionsProgressDialogVisibility(bool toggle);

    void slotOptionsWindowToolbarVisibility(bool toggle);
    void slotOptionsWindowStatusbarVisibility(bool toggle);
    void slotOptionsWindowLeftPanelVisibility(bool toggle);
    void slotOptionsWindowRightPanelVisibility(bool toggle);
    void slotOptionsWindowFullScreen(bool toggle);
    void slotViewDataTable(bool checked);

    void slotOptionsDebugMessages(bool toggle);

    void slotOptionsBackgroundColor(QColor color=QColor());
    void slotOptionsBackgroundImageSelect(bool toggle);
    void slotOptionsBackgroundImage();

    void slotOptionsCanvasOpenGL(const bool &toggle=false);
    void slotOptionsCanvasAntialiasing(bool toggle);
    void slotOptionsCanvasAntialiasingAutoAdjust(const bool &toggle=false);
    void slotOptionsCanvasSmoothPixmapTransform(const bool &toggle=false);
    void slotOptionsCanvasSavePainterState(const bool &toggle=false);
    void slotOptionsCanvasCacheBackground(const bool &toggle=false);
    void slotOptionsCanvasEdgeHighlighting(const bool &toggle=false);

    void slotOptionsCanvasUpdateMode(const QString &mode);
    void slotOptionsCanvasIndexMethod(const QString &method);


    //HELP MENU
    void slotHelpTips();
    void slotHelp();
    void slotHelpCheckUpdateDialog();
    void slotHelpCheckUpdateParse();
    void slotHelpCreateTips();
    void slotHelpSystemInfo();
    void slotHelpAbout();
    void slotAboutQt();
    void slotHelpMessageToUserInfo(const QString text=QString());
    void slotHelpMessageToUserError(const QString text=QString());
    int slotHelpMessageToUser(const int type=0,
                              const QString statusMsg=QString(),
                              const QString text=QString(),
                              const QString info=QString(),
                              QMessageBox::StandardButtons buttons=QMessageBox::NoButton,
                              QMessageBox::StandardButton defBtn=QMessageBox::Ok,
                              const QString btn1=QString(),
                              const QString btn2=QString(),
                              const QString btn3=QString()
            );


    void slotNetworkManagerSslErrors(QNetworkReply *reply, const QList<QSslError> &errors);
    void slotNetworkManagerReplyError(const QNetworkReply::NetworkError &code);

    //Called by Graph to display some message to the user
    void statusMessage(const QString);


    //Called from MW, when user highlights something in the toolbox Comboboxes
    void toolBoxNetworkAutoCreateSelectChanged(const int &selectedIndex);
    void toolBoxEditNodeSubgraphSelectChanged(const int&selectedIndex);
    void toolBoxEditEdgeTransformSelectChanged(const int&selectedIndex);
    void toolBoxFilterSelectChanged(const int &selectedIndex);
    void toolBoxAnalysisMatricesSelectChanged(const int&selectedIndex);
    void toolBoxAnalysisCohesionSelectChanged(const int&selectedIndex);
    void toolBoxAnalysisStrEquivalenceSelectChanged(const int&selectedIndex);
    void toolBoxAnalysisProminenceSelectChanged(const int&selectedIndex);
    void toolBoxAnalysisCommunitiesSelectChanged(const int&selectedIndex);
    void toolBoxLayoutByIndexApplyBtnPressed();
    void toolBoxLayoutForceDirectedApplyBtnPressed();


    void slotProgressBoxCreate(const int &max=0, const QString &msg="Please wait...");
    void slotProgressBoxDestroy(const int &max=0);

protected:
    void resizeEvent(QResizeEvent * e);
    void closeEvent( QCloseEvent* ce );
signals:
    void signalRelationAddAndChange(const QString &relName, const bool &changeRelation=true);
    void signalSetReportsDataDir(const QString &dataDir );

private:

    enum { MaxRecentFiles = 5 };

    int progressCounter;
    int fileType;
    int nodesEstimatedSize;
    int edgesPerNodeEstimatedSize;
    int maxRandomlyCreatedNodes;
    int fortuneCookiesCounter;
    int initZoomIndex, maxZoomIndex;
    bool inverseWeights, askedAboutWeights;

    QString fileName, previous_fileName, fileNameNoPath, progressMsg;
    QString initTextCodecName, userSelectedCodecName;
    QString settingsFilePath, settingsDir ;
    QStringList fortuneCookie;
    QStringList tempFileNameNoPath, tips;
    QStringList prominenceIndexList;
    QStringList recentFiles;
    QStringList iconPathList;
    QStringList nodeShapeList;

    QMap<QString,QString> appSettings;

    QList<QTextCodec *> codecs;

    QList<TextEditor *> m_textEditors;

    QStack<QProgressDialog *> progressDialogs;

    QPrinter *printer, *printerPDF;

    QNetworkAccessManager *networkManager;
    QGraphicsScene *scene;
    GraphicsWidget *graphicsWidget;
    Graph *activeGraph;
    Chart *miniChart;

    DialogWebCrawler *m_WebCrawlerDialog;
    DialogDataSetSelect *m_datasetSelectDialog;
    DialogExportPDF *m_dialogExportPDF;
    DialogExportImage *m_dialogExportImage;
    DialogNodeEdit *m_nodeEditDialog;
    DialogNodeFind *m_nodeFindDialog;
    DialogEdgeDichotomization *m_edgeDichotomizationDialog;
    DialogFilterEdgesByWeight *m_DialogEdgeFilterByWeight;
    FilterBarWidget  *m_filterBar;
    // All snapshot-backed filter chips in bar/stack order (barIndex == stackIndex invariant).
    QList<QPair<QString, FilterCondition::Scope>> m_filterChips;
    QDockWidget      *m_tableDock;
    GraphTableWidget *m_tableWidget;
    DialogRandErdosRenyi *m_randErdosRenyiDialog;
    DialogRandSmallWorld *m_randSmallWorldDialog;
    DialogRandScaleFree *m_randScaleFreeDialog;
    DialogRandRegular *m_randRegularDialog;
    DialogRandLattice *m_randLatticeDialog;
    DialogSimilarityPearson *m_dialogSimilarityPearson;
    DialogSimilarityMatches *m_dialogSimilarityMatches;
    DialogDissimilarities *m_dialogdissimilarities;
    DialogClusteringHierarchical *m_dialogClusteringHierarchical;
    DialogSettings *m_settingsDialog;
    DialogSystemInfo *m_systemInfoDialog;
    DialogPreviewFile *m_dialogPreviewFile;

    QToolBar *toolBar;

    QGroupBox *leftPanel, *rightPanel ;
    QScrollArea *m_leftScrollArea;

    QComboBox *editRelationChangeCombo;

    QMenu *importSubMenu, *exportSubMenu, *editMenu, *analysisMenu, *helpMenu;
    QMenu *optionsMenu, *colorOptionsMenu, *edgeOptionsMenu, *nodeOptionsMenu;
    QMenu *editNodeMenu, *editEdgeMenu, *centrlMenu,  *viewOptionsMenu, *layoutMenu;
    QMenu *cohesionMenu, *strEquivalenceMenu, *communitiesMenu, *connectivityMenu;
    QMenu *matrixMenu;
    QMenu *networkMenu, *randomNetworkMenu, *filterMenu, *subgraphMenu, *recentFilesSubMenu;
    QMenu *randomLayoutMenu, *layoutRadialProminenceMenu, *layoutLevelProminenceMenu;
    QMenu *layoutForceDirectedMenu, *layoutNodeSizeProminenceMenu, *layoutNodeColorProminenceMenu;
    QMenu *colorationMenu;

    QComboBox *toolBoxNetworkAutoCreateSelect, *toolBoxEditNodeSubgraphSelect,
    *toolBoxEditEdgeModeSelect, *toolBoxEditEdgeTransformSelect,
    *toolBoxFilterSelect;
    QComboBox *toolBoxAnalysisCohesionSelect, *toolBoxAnalysisStrEquivalenceSelect,
    *toolBoxAnalysisProminenceSelect, *toolBoxAnalysisCommunitiesSelect,
    *toolBoxAnalysisMatricesSelect;
    QComboBox *toolBoxLayoutByIndexSelect, *toolBoxLayoutByIndexTypeSelect;
    QComboBox *toolBoxLayoutForceDirectedSelect;


    QAction *zoomInAct,*zoomOutAct,*editRotateRightAct,*editRotateLeftAct, *editResetSlidersAct ;
    QToolButton *zoomInBtn,*zoomOutBtn,*rotateLeftBtn,*rotateRightBtn, *resetSlidersBtn ;

    QSlider *zoomSlider, *rotateSlider;

    QAction *networkNewAct, *networkOpenAct, *networkSaveAct, *networkSaveAsAct,
    *networkCloseAct, *networkPrintAct,*networkQuitAct;
    QAction *networkExportImageAct, *networkExportPajek,
    *networkExportPDFAct, *networkExportDLAct, *networkExportGWAct, *networkExportSMAct,
    *networkExportListAct, *networkExportDotAct;
    QAction *networkExportNodesCSVAct, *networkExportEdgesCSVAct,
    *networkExportNodesJSONAct, *networkExportEdgesJSONAct;
    QAction *networkImportPajekAct, *networkImportGMLAct, *networkImportAdjAct, *networkImportListAct,
    *networkImportGraphvizAct , *networkImportUcinetAct, *networkImportTwoModeSM;
    QAction *networkViewFileAct, *openTextEditorAct, *networkViewSociomatrixAct,
    *networkDataSetSelectAct, *networkViewSociomatrixPlotAct;

    QAction *networkRandomErdosRenyiAct;
    QAction *networkRandomGaussianAct;
    QAction *networkRandomLatticeRingAct;
    QAction *networkRandomScaleFreeAct;
    QAction *networkRandomSmallWorldAct;
    QAction *networkRandomRegularSameDegreeAct;
    QAction *networkRandomLatticeAct;
    QAction *networkWebCrawlerAct;

    QAction *editMouseModeScrollAct, *editMouseModeInteractiveAct;
    QAction *editNodeSelectNoneAct, *editNodeSelectAllAct;
    QAction *editNodeSelectedToStarAct, *editNodeSelectedToCycleAct;
    QAction *editNodeSelectedToLineAct, *editNodeSelectedToCliqueAct;
    QAction *editNodeFindAct,*editNodeAddAct, *editNodeRemoveAct;
    QAction *editNodePropertiesAct;
    QAction *editNodeEditSelectionInTableAct;
    QAction *editNodeSetPropertyForSelectionAct;
    QAction *editEdgeSetPropertyForSelectionAct;
    QAction *editEdgeAddAct, *editEdgeRemoveAct, *editEdgePropertiesAct;
    QAction *editNodeNumbersSizeAct, *editNodeLabelsSizeAct;
    QAction *editNodeSizeAllAct, *editNodeShapeAll;
    QAction *editEdgeLabelAct, *editEdgeColorAct, *editEdgeWeightAct;
    QAction *filterNodesByCentralityAct,  *filterNodesByEgoNetworkAct,
        *filterNodesBySelectionAct, *filterNodesByAttributeAct,
        *filterByQueryBuilderAct,
        *filterNodesRestoreAllAct, *editFilterNodesIsolatesAct,
        *editFilterEdgesByWeightAct, *editFilterEdgesRestoreAllAct;
    QAction *editFilterEdgesUnilateralAct;
    QAction *editSubgraphExtractAct, *editSubgraphExtractFromSelectionAct;
    QAction *transformNodes2EdgesAct, *editEdgeSymmetrizeAllAct;
    QAction *editEdgeSymmetrizeStrongTiesAct, *editEdgeUndirectedAllAct;
    QAction *editEdgeDichotomizeAct;
    QAction *editNodeColorAll, *editEdgeColorAllAct,
    *editNodeNumbersColorAct,*editNodeLabelsColorAct,
    *editEdgesCocitationAct;

    QAction *optionsNodeNumbersVisibilityAct, *optionsNodeLabelsVisibilityAct, *optionsNodeNumbersInsideAct;
    QAction *optionsEdgeThicknessPerWeightAct, *optionsEdgeWeightNumbersAct;
    QAction *optionsEdgesVisibilityAct;
    QAction *optionsEdgeArrowsAct, *drawEdgesBezier, *optionsEdgeWeightConsiderAct;
    QAction *optionsEdgeLabelsAct;
    QAction *backgroundImageAct,*changeBackColorAct;
    QAction *fullScreenModeAct;
    QAction *openSettingsAct;
    QAction *viewDataTableAct;

    QAction *helpAboutApp, *helpAboutQt, *helpApp, *tipsApp;
    QAction *helpSystemInfoAct, *helpCheckUpdatesApp;

    QAction *netDensity, *analyzeGraphReciprocityAct, *analyzeGraphSymmetryAct;
    QAction *analyzeGraphDistanceAct, *averGraphDistanceAct;
    QAction *analyzeMatrixDistancesGeodesicAct, *analyzeMatrixGeodesicsAct;
    QAction *analyzeGraphDiameterAct, *analyzeGraphEccentricityAct;
    QAction *analyzeStrEquivalenceTieProfileDissimilaritiesAct;
    QAction *analyzeGraphWalksAct,*analyzeGraphWalksTotalAct, *analyzeMatrixReachabilityAct, *analyzeGraphConnectednessAct;
    QAction *analyzeCommunitiesCliquesAct, *clusteringCoefAct, *analyzeCommunitiesTriadCensusAct;
    QAction *analyzeMatrixAdjTransposeAct, *analyzeMatrixAdjInvertAct;
    QAction *analyzeMatrixAdjCocitationAct;
    QAction *analyzeMatrixDegreeAct, *analyzeMatrixLaplacianAct;
    QAction *analyzeStrEquivalenceClusteringHierarchicalAct, *analyzeStrEquivalencePearsonAct;
    QAction *analyzeStrEquivalenceMatchesAct;
    QAction *cDegreeAct, *cInDegreeAct, *cClosenessAct, *cInfluenceRangeClosenessAct,
    *cBetweennessAct, *cInformationAct, *cEigenvectorAct, *cPageRankAct,
    *cStressAct, *cPowerAct, *cEccentAct, *cProximityPrestigeAct;
    QAction *layoutRandomAct, *layoutRandomRadialAct, *layoutEgoRadialAct, *layoutGuidesAct;
    QAction *layoutRadialProminence_DC_Act, *layoutRadialProminence_DP_Act,
    *layoutRadialProminence_CC_Act, *layoutRadialProminence_SC_Act, *layoutRadialProminence_EC_Act,
    *layoutRadialProminence_PC_Act, *layoutRadialProminence_BC_Act, *layoutRadialProminence_IC_Act,
    *layoutRadialProminence_EVC_Act,
    *layoutRadialProminence_IRCC_Act,*layoutRadialProminence_PRP_Act, *layoutRadialProminence_PP_Act;
    QAction *layoutLevelProminence_DC_Act, *layoutLevelProminence_DP_Act,
    *layoutLevelProminence_CC_Act, *layoutLevelProminence_SC_Act, *layoutLevelProminence_EC_Act,
    *layoutLevelProminence_PC_Act, *layoutLevelProminence_BC_Act, *layoutLevelProminence_IC_Act,
    *layoutLevelProminence_EVC_Act,
    *layoutLevelProminence_IRCC_Act,*layoutLevelProminence_PRP_Act, *layoutLevelProminence_PP_Act;
    QAction *layoutNodeSizeProminence_DC_Act, *layoutNodeSizeProminence_DP_Act,
    *layoutNodeSizeProminence_CC_Act, *layoutNodeSizeProminence_SC_Act, *layoutNodeSizeProminence_EC_Act,
    *layoutNodeSizeProminence_PC_Act, *layoutNodeSizeProminence_BC_Act, *layoutNodeSizeProminence_IC_Act,
    *layoutNodeSizeProminence_EVC_Act,
    *layoutNodeSizeProminence_IRCC_Act,*layoutNodeSizeProminence_PRP_Act, *layoutNodeSizeProminence_PP_Act;
    QAction *layoutNodeColorProminence_DC_Act, *layoutNodeColorProminence_DP_Act,
    *layoutNodeColorProminence_CC_Act, *layoutNodeColorProminence_SC_Act, *layoutNodeColorProminence_EC_Act,
    *layoutNodeColorProminence_PC_Act, *layoutNodeColorProminence_BC_Act, *layoutNodeColorProminence_IC_Act,
    *layoutNodeColorProminence_EVC_Act,
    *layoutNodeColorProminence_IRCC_Act,*layoutNodeColorProminence_PRP_Act, *layoutNodeColorProminence_PP_Act,
    *layoutNodeColorProminence_CLC_Act;
    QAction *layoutNodeColorByComponentAct;

    QAction *strongColorationAct, *regularColorationAct;
    QAction *layoutFDP_Eades_Act, *layoutFDP_FR_Act;
    QAction *layoutFDP_KamadaKawai_Act;

    QAction *editRelationNextAct, *editRelationPreviousAct, *editRelationAddAct;
    QAction *editRelationRenameAct;
    QAction *recentFileActs[MaxRecentFiles];

    QLabel *rightPanelNetworkTypeLCD ;
    QLabel *rightPanelEdgesLabel;
    QLabel *rightPanelNodesLCD;
    QLabel *rightPanelEdgesLCD;
    QLabel *rightPanelDensityLCD;

    QLabel *rightPanelSelectedNodesLCD;
    QLabel *rightPanelSelectedEdgesLCD;
    QLabel *rightPanelSelectedEdgesLabel;

    QLabel *rightPanelClickedNodeLCD;
    QLabel *rightPanelClickedNodeInDegreeLabel;
    QLabel *rightPanelClickedNodeInDegreeLCD;
    QLabel *rightPanelClickedNodeOutDegreeLabel;
    QLabel *rightPanelClickedNodeOutDegreeLCD;

    QLabel *rightPanelClickedEdgeNameLabel;
    QLabel *rightPanelClickedEdgeNameLCD;
    QLabel *rightPanelClickedEdgeWeightLabel;
    QLabel *rightPanelClickedEdgeWeightLCD;
    QLabel *rightPanelClickedEdgeReciprocalWeightLabel;
    QLabel *rightPanelClickedEdgeReciprocalWeightLCD;

    QPushButton *m_networkToggleBtn;
    QPushButton *m_selectionToggleBtn;
    QPushButton *m_clickedNodeToggleBtn;
    QPushButton *m_clickedEdgeToggleBtn;
    QPushButton *m_chartToggleBtn;

    QWidget *m_networkSection;
    QWidget *m_selectionSection;
    QWidget *m_clickedNodeSection;
    QWidget *m_clickedEdgeSection;




};
#endif 

