LibreOffice Module sfx2 (master) 1
Macros | Functions | Variables
templatedlg.cxx File Reference
#include <sfx2/templatedlg.hxx>
#include <sfx2/inputdlg.hxx>
#include <sfx2/module.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/propertyvalue.hxx>
#include <comphelper/string.hxx>
#include <comphelper/storagehelper.hxx>
#include <sfx2/app.hxx>
#include <sfx2/docfac.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/fcontnr.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/sfxresid.hxx>
#include <sfx2/templatedlglocalview.hxx>
#include <templatecontaineritem.hxx>
#include <templateviewitem.hxx>
#include <sfx2/thumbnailviewitem.hxx>
#include <sot/storage.hxx>
#include <tools/urlobj.hxx>
#include <unotools/moduleoptions.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/viewoptions.hxx>
#include <vcl/event.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/document/MacroExecMode.hpp>
#include <com/sun/star/document/UpdateDocMode.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/XFolderPicker2.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
#include <comphelper/dispatchcommand.hxx>
#include <sfx2/strings.hrc>
#include <bitmaps.hlst>
Include dependency graph for templatedlg.cxx:

Go to the source code of this file.

Macros

#define MNI_ALL_APPLICATIONS   0
 
#define MNI_WRITER   1
 
#define MNI_CALC   2
 
#define MNI_IMPRESS   3
 
#define MNI_DRAW   4
 

Functions

static bool lcl_getServiceName (const OUString &rFileURL, OUString &rName)
 
static std::vector< OUString > lcl_getAllFactoryURLs ()
 
static bool cmpSelectionItems (const ThumbnailViewItem *pItem1, const ThumbnailViewItem *pItem2)
 
 IMPL_LINK (SfxTemplateManagerDlg, KeyInputHdl, const KeyEvent &, rKeyEvent, bool)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, SelectApplicationHdl, weld::ComboBox &, void)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, SelectRegionHdl, weld::ComboBox &, void)
 
 IMPL_LINK (SfxTemplateManagerDlg, TVItemStateHdl, const ThumbnailViewItem *, pItem, void)
 
 IMPL_LINK (SfxTemplateManagerDlg, MenuSelectHdl, const OUString &, rIdent, void)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, OkClickHdl, weld::Button &, void)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, MoveTemplateHdl, void *, void)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, ExportTemplateHdl, void *, void)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, OpenRegionHdl, void *, void)
 
 IMPL_LINK (SfxTemplateManagerDlg, CreateContextMenuHdl, ThumbnailViewItem *, pItem, void)
 
 IMPL_LINK (SfxTemplateManagerDlg, OpenTemplateHdl, ThumbnailViewItem *, pItem, void)
 
 IMPL_LINK (SfxTemplateManagerDlg, EditTemplateHdl, ThumbnailViewItem *, pItem, void)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, DeleteTemplateHdl, void *, void)
 
 IMPL_LINK (SfxTemplateManagerDlg, DefaultTemplateHdl, ThumbnailViewItem *, pItem, void)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, SearchUpdateHdl, weld::Entry &, void)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, ImplUpdateDataHdl, Timer *, void)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, LoseFocusHdl, weld::Widget &, void)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, ListViewHdl, weld::Toggleable &, void)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, ThumbnailViewHdl, weld::Toggleable &, void)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, FocusRectLocalHdl, weld::Widget &, tools::Rectangle)
 
 IMPL_LINK_NOARG (SfxTemplateManagerDlg, GetFocusHdl, weld::Widget &, void)
 
 IMPL_LINK_NOARG (SfxTemplateCategoryDialog, NewCategoryEditHdl, weld::Entry &, void)
 
 IMPL_LINK_NOARG (SfxTemplateCategoryDialog, SelectCategoryHdl, weld::TreeView &, void)
 
 IMPL_LINK_NOARG (SfxTemplateSelectionDlg, TimeOut, Timer *, void)
 
 IMPL_LINK (SfxTemplateSelectionDlg, OpenTemplateHdl, ThumbnailViewItem *, pItem, void)
 
 IMPL_LINK_NOARG (SfxTemplateSelectionDlg, OkClickHdl, weld::Button &, void)
 

Variables

constexpr OUStringLiteral TM_SETTING_MANAGER = u"TemplateManager"
 
constexpr OUStringLiteral TM_SETTING_LASTFOLDER = u"LastFolder"
 
constexpr OUStringLiteral TM_SETTING_LASTAPPLICATION = u"LastApplication"
 
constexpr OUStringLiteral TM_SETTING_VIEWMODE = u"ViewMode"
 
constexpr OUStringLiteral MNI_ACTION_NEW_FOLDER = u"new"
 
constexpr OUStringLiteral MNI_ACTION_RENAME_FOLDER = u"rename"
 
constexpr OUStringLiteral MNI_ACTION_DELETE_FOLDER = u"delete"
 
constexpr OUStringLiteral MNI_ACTION_DEFAULT = u"default"
 
constexpr OUStringLiteral MNI_ACTION_DEFAULT_WRITER = u"default_writer"
 
constexpr OUStringLiteral MNI_ACTION_DEFAULT_CALC = u"default_calc"
 
constexpr OUStringLiteral MNI_ACTION_DEFAULT_IMPRESS = u"default_impress"
 
constexpr OUStringLiteral MNI_ACTION_DEFAULT_DRAW = u"default_draw"
 
constexpr OUStringLiteral MNI_ACTION_IMPORT = u"import_template"
 
constexpr OUStringLiteral MNI_ACTION_EXTENSIONS = u"extensions"
 

Macro Definition Documentation

◆ MNI_ALL_APPLICATIONS

#define MNI_ALL_APPLICATIONS   0

Definition at line 71 of file templatedlg.cxx.

◆ MNI_CALC

#define MNI_CALC   2

Definition at line 73 of file templatedlg.cxx.

◆ MNI_DRAW

#define MNI_DRAW   4

Definition at line 75 of file templatedlg.cxx.

◆ MNI_IMPRESS

#define MNI_IMPRESS   3

Definition at line 74 of file templatedlg.cxx.

◆ MNI_WRITER

#define MNI_WRITER   1

Definition at line 72 of file templatedlg.cxx.

Function Documentation

◆ cmpSelectionItems()

static bool cmpSelectionItems ( const ThumbnailViewItem pItem1,
const ThumbnailViewItem pItem2 
)
static

Definition at line 149 of file templatedlg.cxx.

References ThumbnailViewItem::mnId.

◆ IMPL_LINK() [1/8]

IMPL_LINK ( SfxTemplateManagerDlg  ,
CreateContextMenuHdl  ,
ThumbnailViewItem ,
pItem  ,
void   
)

◆ IMPL_LINK() [2/8]

IMPL_LINK ( SfxTemplateManagerDlg  ,
DefaultTemplateHdl  ,
ThumbnailViewItem ,
pItem  ,
void   
)

◆ IMPL_LINK() [3/8]

IMPL_LINK ( SfxTemplateManagerDlg  ,
EditTemplateHdl  ,
ThumbnailViewItem ,
pItem  ,
void   
)

◆ IMPL_LINK() [4/8]

IMPL_LINK ( SfxTemplateManagerDlg  ,
KeyInputHdl  ,
const KeyEvent ,
rKeyEvent  ,
bool   
)

Definition at line 269 of file templatedlg.cxx.

References vcl::KeyCode::GetCode(), and KEY_ESCAPE.

◆ IMPL_LINK() [5/8]

IMPL_LINK ( SfxTemplateManagerDlg  ,
MenuSelectHdl  ,
const OUString &  ,
rIdent  ,
void   
)

◆ IMPL_LINK() [6/8]

IMPL_LINK ( SfxTemplateManagerDlg  ,
OpenTemplateHdl  ,
ThumbnailViewItem ,
pItem  ,
void   
)

◆ IMPL_LINK() [7/8]

IMPL_LINK ( SfxTemplateManagerDlg  ,
TVItemStateHdl  ,
const ThumbnailViewItem ,
pItem  ,
void   
)

Definition at line 503 of file templatedlg.cxx.

◆ IMPL_LINK() [8/8]

IMPL_LINK ( SfxTemplateSelectionDlg  ,
OpenTemplateHdl  ,
ThumbnailViewItem ,
pItem  ,
void   
)

Definition at line 1378 of file templatedlg.cxx.

References TemplateViewItem::getPath(), m_xDialog, and RET_OK.

◆ IMPL_LINK_NOARG() [1/18]

IMPL_LINK_NOARG ( SfxTemplateCategoryDialog  ,
NewCategoryEditHdl  ,
weld::Entry ,
void   
)

Definition at line 1283 of file templatedlg.cxx.

References comphelper::string::strip().

◆ IMPL_LINK_NOARG() [2/18]

IMPL_LINK_NOARG ( SfxTemplateCategoryDialog  ,
SelectCategoryHdl  ,
weld::TreeView ,
void   
)

Definition at line 1300 of file templatedlg.cxx.

◆ IMPL_LINK_NOARG() [3/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
DeleteTemplateHdl  ,
void *  ,
void   
)

◆ IMPL_LINK_NOARG() [4/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
ExportTemplateHdl  ,
void *  ,
void   
)

Definition at line 601 of file templatedlg.cxx.

◆ IMPL_LINK_NOARG() [5/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
FocusRectLocalHdl  ,
weld::Widget ,
tools::Rectangle   
)

Definition at line 835 of file templatedlg.cxx.

◆ IMPL_LINK_NOARG() [6/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
GetFocusHdl  ,
weld::Widget ,
void   
)

Definition at line 860 of file templatedlg.cxx.

◆ IMPL_LINK_NOARG() [7/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
ImplUpdateDataHdl  ,
Timer ,
void   
)

Definition at line 810 of file templatedlg.cxx.

◆ IMPL_LINK_NOARG() [8/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
ListViewHdl  ,
weld::Toggleable ,
void   
)

Definition at line 824 of file templatedlg.cxx.

References eListView.

◆ IMPL_LINK_NOARG() [9/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
LoseFocusHdl  ,
weld::Widget ,
void   
)

Definition at line 815 of file templatedlg.cxx.

◆ IMPL_LINK_NOARG() [10/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
MoveTemplateHdl  ,
void *  ,
void   
)

◆ IMPL_LINK_NOARG() [11/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
OkClickHdl  ,
weld::Button ,
void   
)

Definition at line 562 of file templatedlg.cxx.

References m_xDialog, and RET_OK.

◆ IMPL_LINK_NOARG() [12/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
OpenRegionHdl  ,
void *  ,
void   
)

Definition at line 655 of file templatedlg.cxx.

◆ IMPL_LINK_NOARG() [13/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
SearchUpdateHdl  ,
weld::Entry ,
void   
)

Definition at line 805 of file templatedlg.cxx.

◆ IMPL_LINK_NOARG() [14/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
SelectApplicationHdl  ,
weld::ComboBox ,
void   
)

Definition at line 478 of file templatedlg.cxx.

◆ IMPL_LINK_NOARG() [15/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
SelectRegionHdl  ,
weld::ComboBox ,
void   
)

Definition at line 485 of file templatedlg.cxx.

References MNI_ACTION_DELETE_FOLDER, and MNI_ACTION_RENAME_FOLDER.

◆ IMPL_LINK_NOARG() [16/18]

IMPL_LINK_NOARG ( SfxTemplateManagerDlg  ,
ThumbnailViewHdl  ,
weld::Toggleable ,
void   
)

Definition at line 829 of file templatedlg.cxx.

References eThumbnailView.

◆ IMPL_LINK_NOARG() [17/18]

IMPL_LINK_NOARG ( SfxTemplateSelectionDlg  ,
OkClickHdl  ,
weld::Button ,
void   
)

Definition at line 1386 of file templatedlg.cxx.

References TemplateViewItem::getPath(), m_xDialog, and RET_OK.

◆ IMPL_LINK_NOARG() [18/18]

IMPL_LINK_NOARG ( SfxTemplateSelectionDlg  ,
TimeOut  ,
Timer ,
void   
)

Definition at line 1373 of file templatedlg.cxx.

References m_xDialog.

◆ lcl_getAllFactoryURLs()

static std::vector< OUString > lcl_getAllFactoryURLs ( )
static

◆ lcl_getServiceName()

static bool lcl_getServiceName ( const OUString &  rFileURL,
OUString &  rName 
)
static

Variable Documentation

◆ MNI_ACTION_DEFAULT

constexpr OUStringLiteral MNI_ACTION_DEFAULT = u"default"
constexpr

◆ MNI_ACTION_DEFAULT_CALC

constexpr OUStringLiteral MNI_ACTION_DEFAULT_CALC = u"default_calc"
constexpr

◆ MNI_ACTION_DEFAULT_DRAW

constexpr OUStringLiteral MNI_ACTION_DEFAULT_DRAW = u"default_draw"
constexpr

◆ MNI_ACTION_DEFAULT_IMPRESS

constexpr OUStringLiteral MNI_ACTION_DEFAULT_IMPRESS = u"default_impress"
constexpr

◆ MNI_ACTION_DEFAULT_WRITER

constexpr OUStringLiteral MNI_ACTION_DEFAULT_WRITER = u"default_writer"
constexpr

◆ MNI_ACTION_DELETE_FOLDER

constexpr OUStringLiteral MNI_ACTION_DELETE_FOLDER = u"delete"
constexpr

◆ MNI_ACTION_EXTENSIONS

constexpr OUStringLiteral MNI_ACTION_EXTENSIONS = u"extensions"
constexpr

Definition at line 70 of file templatedlg.cxx.

Referenced by IMPL_LINK(), and SfxTemplateManagerDlg::SfxTemplateManagerDlg().

◆ MNI_ACTION_IMPORT

constexpr OUStringLiteral MNI_ACTION_IMPORT = u"import_template"
constexpr

Definition at line 69 of file templatedlg.cxx.

Referenced by IMPL_LINK(), and SfxTemplateManagerDlg::SfxTemplateManagerDlg().

◆ MNI_ACTION_NEW_FOLDER

constexpr OUStringLiteral MNI_ACTION_NEW_FOLDER = u"new"
constexpr

Definition at line 61 of file templatedlg.cxx.

Referenced by IMPL_LINK(), and SfxTemplateManagerDlg::SfxTemplateManagerDlg().

◆ MNI_ACTION_RENAME_FOLDER

constexpr OUStringLiteral MNI_ACTION_RENAME_FOLDER = u"rename"
constexpr

◆ TM_SETTING_LASTAPPLICATION

constexpr OUStringLiteral TM_SETTING_LASTAPPLICATION = u"LastApplication"
constexpr

◆ TM_SETTING_LASTFOLDER

constexpr OUStringLiteral TM_SETTING_LASTFOLDER = u"LastFolder"
constexpr

◆ TM_SETTING_MANAGER

constexpr OUStringLiteral TM_SETTING_MANAGER = u"TemplateManager"
constexpr

◆ TM_SETTING_VIEWMODE

constexpr OUStringLiteral TM_SETTING_VIEWMODE = u"ViewMode"
constexpr