LCOV - code coverage report
Current view: top level - libreoffice/sfx2/inc - templatedlg.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 1 0.0 %
Date: 2012-12-27 Functions: 0 1 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * Copyright 2012 LibreOffice contributors.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  */
       9             : 
      10             : #ifndef TEMPLATEDLG_HXX
      11             : #define TEMPLATEDLG_HXX
      12             : 
      13             : #include <set>
      14             : 
      15             : #include <vcl/dialog.hxx>
      16             : #include <vcl/button.hxx>
      17             : #include <vcl/tabctrl.hxx>
      18             : #include <com/sun/star/frame/XDesktop2.hpp>
      19             : 
      20             : class Edit;
      21             : class PopupMenu;
      22             : class SfxTemplateInfoDlg;
      23             : class TemplateAbstractView;
      24             : class TemplateLocalView;
      25             : class TemplateRemoteView;
      26             : class TemplateRepository;
      27             : class TemplateSearchView;
      28             : class ThumbnailView;
      29             : class ThumbnailViewItem;
      30             : class ToolBox;
      31             : 
      32             : namespace com {
      33             :     namespace sun { namespace star { namespace frame {
      34             :         class XComponentLoader;
      35             :         class XModel;
      36             :     }   }   }
      37             : }
      38             : 
      39             : class SfxTemplateManagerDlg : public ModelessDialog
      40             : {
      41             : public:
      42             : 
      43             :     SfxTemplateManagerDlg (Window *parent = DIALOG_NO_PARENT);
      44             : 
      45             :     ~SfxTemplateManagerDlg ();
      46             : 
      47             :     void setSaveMode (bool bMode);
      48             : 
      49             :     void setDocumentModel (const com::sun::star::uno::Reference<com::sun::star::frame::XModel> &rModel);
      50             : 
      51             :     DECL_LINK(ActivatePageHdl, void*);
      52             : 
      53             : private:
      54             : 
      55             :     virtual void MouseButtonDown( const MouseEvent& rMEvt );
      56             : 
      57             :     virtual void Resize ();
      58             : 
      59             :     DECL_LINK(CloseOverlayHdl, void*);
      60             : 
      61             :     DECL_LINK(TBXViewHdl, void*);
      62             :     DECL_LINK(TBXActionHdl, void*);
      63             :     DECL_LINK(TBXTemplateHdl, void*);
      64             :     DECL_LINK(TBXDropdownHdl, ToolBox*);
      65             : 
      66             :     DECL_LINK(TVFolderStateHdl, const ThumbnailViewItem*);
      67             :     DECL_LINK(TVTemplateStateHdl, const ThumbnailViewItem*);
      68             : 
      69             :     DECL_LINK(MenuSelectHdl, Menu*);
      70             :     DECL_LINK(MoveMenuSelectHdl, Menu*);
      71             :     DECL_LINK(RepositoryMenuSelectHdl, Menu*);
      72             :     DECL_LINK(DefaultTemplateMenuSelectHdl, Menu*);
      73             : 
      74             :     DECL_LINK(OpenTemplateHdl, ThumbnailViewItem*);
      75             : 
      76             :     DECL_LINK(SearchUpdateHdl, void*);
      77             : 
      78             :     void OnTemplateImport ();
      79             :     void OnTemplateSearch ();
      80             :     void OnTemplateEdit ();
      81             :     void OnTemplateProperties ();
      82             :     void OnTemplateDelete ();
      83             :     void OnTemplateAsDefault ();
      84             :     void OnTemplateExport ();
      85             :     void OnFolderDelete ();
      86             :     void OnRepositoryDelete ();
      87             :     void OnTemplateSaveAs ();
      88             : 
      89             :     void createRepositoryMenu ();
      90             : 
      91             :     void createDefaultTemplateMenu ();
      92             : 
      93             :     // Exchange view between local/online view.
      94             :     void switchMainView (bool bDisplayLocal);
      95             : 
      96             :     /**
      97             :      *
      98             :      * Move templates stored in the filesystem to another folder.
      99             :      *
     100             :      **/
     101             : 
     102             :     void localMoveTo (sal_uInt16 nMenuId);
     103             : 
     104             :     void remoteMoveTo (const sal_uInt16 nMenuId);
     105             : 
     106             :     /**
     107             :      *
     108             :      * Move search result templates stored in the filesystem to another folder.
     109             :      *
     110             :      **/
     111             : 
     112             :     void localSearchMoveTo (sal_uInt16 nMenuId);
     113             : 
     114             :     // Remote repositories handling methods
     115             :     void loadRepositories ();
     116             : 
     117           0 :     const std::vector<TemplateRepository*>& getRepositories () const { return maRepositories; }
     118             : 
     119             :     bool insertRepository (const OUString &rName, const OUString &rURL);
     120             : 
     121             :     bool deleteRepository (const sal_uInt16 nRepositoryId);
     122             : 
     123             :     void syncRepositories () const;
     124             : 
     125             : private:
     126             : 
     127             :     TabControl maTabControl;
     128             :     Control *mpToolbars;
     129             : 
     130             :     Edit *mpSearchEdit;
     131             :     ToolBox *mpViewBar;
     132             :     ToolBox *mpActionBar;
     133             :     ToolBox *mpTemplateBar;
     134             :     TemplateSearchView *mpSearchView;
     135             :     TemplateAbstractView *mpCurView;
     136             :     TemplateLocalView *maView;
     137             :     TemplateRemoteView *mpOnlineView;
     138             :     PopupMenu *mpActionMenu;
     139             :     PopupMenu *mpRepositoryMenu;
     140             :     PopupMenu *mpTemplateDefaultMenu;
     141             : 
     142             :     std::set<const ThumbnailViewItem*> maSelTemplates;
     143             :     std::set<const ThumbnailViewItem*> maSelFolders;
     144             : 
     145             :     bool mbIsSaveMode;  ///< Flag that indicates if we are in save mode or not.
     146             :     com::sun::star::uno::Reference< com::sun::star::frame::XModel > m_xModel;
     147             :     com::sun::star::uno::Reference< com::sun::star::frame::XDesktop2 > mxDesktop;
     148             : 
     149             :     bool mbIsSynced; ///< Tells whether maRepositories is synchronized with the user config
     150             :     std::vector<TemplateRepository*> maRepositories; ///< Stores the remote repositories for templates
     151             : };
     152             : 
     153             : #endif // TEMPLATEDLG_HXX
     154             : 
     155             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10