LCOV - code coverage report
Current view: top level - include/sfx2 - templatedlg.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 1 0.0 %
Date: 2015-06-13 12:38:46 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             :  * This file is part of the LibreOffice project.
       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 INCLUDED_SFX2_INC_TEMPLATEDLG_HXX
      11             : #define INCLUDED_SFX2_INC_TEMPLATEDLG_HXX
      12             : 
      13             : #include <sal/config.h>
      14             : #include <sfx2/dllapi.h>
      15             : 
      16             : #include <set>
      17             : 
      18             : #include <vcl/dialog.hxx>
      19             : #include <vcl/button.hxx>
      20             : #include <vcl/tabctrl.hxx>
      21             : #include <vcl/tabpage.hxx>
      22             : #include <com/sun/star/frame/XDesktop2.hpp>
      23             : 
      24             : #include <sfx2/templateabstractview.hxx>
      25             : 
      26             : class Edit;
      27             : class PopupMenu;
      28             : class SfxTemplateInfoDlg;
      29             : class TemplateAbstractView;
      30             : class TemplateLocalView;
      31             : class TemplateRemoteView;
      32             : class TemplateRepository;
      33             : class TemplateSearchView;
      34             : class ThumbnailView;
      35             : class ThumbnailViewItem;
      36             : class ToolBox;
      37             : 
      38             : namespace com {
      39             :     namespace sun { namespace star { namespace frame {
      40             :         class XComponentLoader;
      41             :         class XModel;
      42             :     }   }   }
      43             : }
      44             : 
      45             : class SFX2_DLLPUBLIC SfxTemplateManagerDlg : public ModalDialog
      46             : {
      47             :     typedef bool (*selection_cmp_fn)(const ThumbnailViewItem*,const ThumbnailViewItem*);
      48             : 
      49             : public:
      50             : 
      51             :     SfxTemplateManagerDlg(vcl::Window *parent = NULL);
      52             : 
      53             :     virtual ~SfxTemplateManagerDlg();
      54             :     virtual void dispose() SAL_OVERRIDE;
      55             : 
      56             :     void setSaveMode();
      57             : 
      58             :     void setDocumentModel (const com::sun::star::uno::Reference<com::sun::star::frame::XModel> &rModel);
      59             : 
      60             :     DECL_LINK(ActivatePageHdl, void*);
      61             : 
      62             : private:
      63             : 
      64             :     void readSettings ();
      65             : 
      66             :     void writeSettings ();
      67             : 
      68             :     DECL_LINK_TYPED(TBXViewHdl, ToolBox*, void);
      69             :     DECL_LINK_TYPED(TBXActionHdl, ToolBox*, void);
      70             :     DECL_LINK_TYPED(TBXTemplateHdl, ToolBox*, void);
      71             :     DECL_LINK_TYPED(TBXDropdownHdl, ToolBox*, void);
      72             : 
      73             :     DECL_LINK(TVItemStateHdl, const ThumbnailViewItem*);
      74             : 
      75             :     DECL_LINK(MenuSelectHdl, Menu*);
      76             :     DECL_LINK(MoveMenuSelectHdl, Menu*);
      77             :     DECL_LINK(RepositoryMenuSelectHdl, Menu*);
      78             :     DECL_LINK(DefaultTemplateMenuSelectHdl, Menu*);
      79             : 
      80             :     DECL_LINK(OpenRegionHdl, void*);
      81             :     DECL_LINK(OpenTemplateHdl, ThumbnailViewItem*);
      82             : 
      83             :     DECL_LINK(SearchUpdateHdl, void*);
      84             : 
      85             :     void OnTemplateImport ();
      86             :     void OnTemplateSearch ();
      87             :     static void OnTemplateLink ();
      88             :     void OnTemplateOpen ();
      89             :     void OnTemplateEdit ();
      90             :     void OnTemplateProperties ();
      91             :     void OnTemplateDelete ();
      92             :     void OnTemplateAsDefault ();
      93             :     void OnTemplateExport ();
      94             : 
      95             :     void OnTemplateState (const ThumbnailViewItem *pItem);
      96             : 
      97             :     void OnFolderNew ();
      98             :     void OnFolderDelete ();
      99             : 
     100             :     void OnRegionState (const ThumbnailViewItem *pItem);
     101             : 
     102             :     void OnRepositoryDelete ();
     103             :     void OnTemplateSaveAs ();
     104             : 
     105             :     void createRepositoryMenu ();
     106             : 
     107             :     void createDefaultTemplateMenu ();
     108             : 
     109             :     // Exchange view between local/online view.
     110             :     void switchMainView (bool bDisplayLocal);
     111             : 
     112             :     /**
     113             :      *
     114             :      * Move templates stored in the filesystem to another folder.
     115             :      *
     116             :      **/
     117             : 
     118             :     void localMoveTo (sal_uInt16 nMenuId);
     119             : 
     120             :     void remoteMoveTo (const sal_uInt16 nMenuId);
     121             : 
     122             :     /**
     123             :      *
     124             :      * Move search result templates stored in the filesystem to another folder.
     125             :      *
     126             :      **/
     127             : 
     128             :     void localSearchMoveTo (sal_uInt16 nMenuId);
     129             : 
     130             :     // Remote repositories handling methods
     131             :     void loadRepositories ();
     132             : 
     133           0 :     const std::vector<TemplateRepository*>& getRepositories () const { return maRepositories; }
     134             : 
     135             :     bool insertRepository (const OUString &rName, const OUString &rURL);
     136             : 
     137             :     bool deleteRepository (const sal_uInt16 nRepositoryId);
     138             : 
     139             :     void syncRepositories () const;
     140             : 
     141             :     /// Return filter according to the currently selected tab page.
     142             :     FILTER_APPLICATION getCurrentFilter();
     143             : 
     144             : private:
     145             : 
     146             :     VclPtr<TabControl> mpTabControl;
     147             : 
     148             :     VclPtr<Edit> mpSearchEdit;
     149             :     VclPtr<ToolBox> mpViewBar;
     150             :     VclPtr<ToolBox> mpActionBar;
     151             :     VclPtr<ToolBox> mpTemplateBar;
     152             :     VclPtr<TemplateSearchView> mpSearchView;
     153             :     VclPtr<TemplateAbstractView> mpCurView;
     154             :     VclPtr<TemplateLocalView> mpLocalView;
     155             :     VclPtr<TemplateRemoteView> mpRemoteView;
     156             :     PopupMenu *mpActionMenu;
     157             :     PopupMenu *mpRepositoryMenu;
     158             :     PopupMenu *mpTemplateDefaultMenu;
     159             : 
     160             :     std::set<const ThumbnailViewItem*,selection_cmp_fn> maSelTemplates;
     161             :     std::set<const ThumbnailViewItem*,selection_cmp_fn> maSelFolders;
     162             : 
     163             :     bool mbIsSaveMode;  ///< Flag that indicates if we are in save mode or not.
     164             :     com::sun::star::uno::Reference< com::sun::star::frame::XModel > m_xModel;
     165             :     com::sun::star::uno::Reference< com::sun::star::frame::XDesktop2 > mxDesktop;
     166             : 
     167             :     bool mbIsSynced; ///< Tells whether maRepositories is synchronized with the user config
     168             :     std::vector<TemplateRepository*> maRepositories; ///< Stores the remote repositories for templates
     169             : };
     170             : 
     171             : #endif // INCLUDED_SFX2_INC_TEMPLATEDLG_HXX
     172             : 
     173             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11