LibreOffice Module sd (master) 1
|
This class scans the template folders for impress templates. More...
#include <TemplateScanner.hxx>
Classes | |
class | FolderDescriptorList |
Public Member Functions | |
TemplateScanner () | |
Create a new template scanner and prepare but do not execute the scanning. More... | |
virtual | ~TemplateScanner () |
The destructor deletes any remaining entries of the local list of templates. More... | |
virtual void | RunNextStep () override |
Implementation of the AsynchronousTask interface method. More... | |
virtual bool | HasNextStep () override |
Implementation of the AsynchronousTask interface method. More... | |
const TemplateEntry * | GetLastAddedEntry () const |
Return the TemplateDir object that was last added to mpTemplateEntries. More... | |
virtual void | RunNextStep ()=0 |
Run the next step of the task. More... | |
virtual bool | HasNextStep ()=0 |
Return <TRUE> when there is at least one more step to execute. More... | |
Private Types | |
enum | State { INITIALIZE_SCANNING , INITIALIZE_FOLDER_SCANNING , GATHER_FOLDER_LIST , SCAN_FOLDER , INITIALIZE_ENTRY_SCAN , SCAN_ENTRY , DONE , ERROR } |
The current state determines which step will be executed next by RunNextStep(). More... | |
Private Member Functions | |
State | GetTemplateRoot () |
Obtain the root folder of the template folder hierarchy. More... | |
State | InitializeFolderScanning () |
Initialize the scanning of folders. More... | |
State | GatherFolderList () |
Collect all available top-level folders in an ordered list which can then be processed by ScanFolder(). More... | |
State | ScanFolder () |
From the list of top-level folders collected by GatherFolderList() the one with highest priority is processed. More... | |
State | InitializeEntryScanning () |
Initialize the scanning of entries of a top-level folder. More... | |
State | ScanEntry () |
Scan one entry. More... | |
Private Attributes | |
State | meState |
::ucbhelper::Content | maFolderContent |
::std::vector< std::unique_ptr< TemplateEntry > > | mpTemplateEntries |
std::unique_ptr< FolderDescriptorList > | mpFolderDescriptors |
css::uno::Reference< css::ucb::XContent > | mxTemplateRoot |
Set of state variables used by the methods InitializeFolderScanning(), GatherFolderList(), ScanFolder(), InitializeEntryScanning(), and ScanEntry(). More... | |
css::uno::Reference< css::ucb::XCommandEnvironment > | mxFolderEnvironment |
css::uno::Reference< css::ucb::XCommandEnvironment > | mxEntryEnvironment |
css::uno::Reference< css::sdbc::XResultSet > | mxFolderResultSet |
css::uno::Reference< css::sdbc::XResultSet > | mxEntryResultSet |
Additional Inherited Members | |
Protected Member Functions inherited from sd::tools::AsynchronousTask | |
~AsynchronousTask () | |
This class scans the template folders for impress templates.
There are two ways to use this class.
Definition at line 69 of file TemplateScanner.hxx.
|
private |
The current state determines which step will be executed next by RunNextStep().
Enumerator | |
---|---|
INITIALIZE_SCANNING | |
INITIALIZE_FOLDER_SCANNING | |
GATHER_FOLDER_LIST | |
SCAN_FOLDER | |
INITIALIZE_ENTRY_SCAN | |
SCAN_ENTRY | |
DONE | |
ERROR |
Definition at line 104 of file TemplateScanner.hxx.
sd::TemplateScanner::TemplateScanner | ( | ) |
Create a new template scanner and prepare but do not execute the scanning.
Definition at line 111 of file TemplateScanner.cxx.
|
virtual |
The destructor deletes any remaining entries of the local list of templates.
Definition at line 118 of file TemplateScanner.cxx.
|
private |
Collect all available top-level folders in an ordered list which can then be processed by ScanFolder().
Definition at line 224 of file TemplateScanner.cxx.
References ERROR, mpFolderDescriptors, mxFolderEnvironment, mxFolderResultSet, and SCAN_FOLDER.
Referenced by RunNextStep().
|
inline |
Return the TemplateDir object that was last added to mpTemplateEntries.
Definition at line 95 of file TemplateScanner.hxx.
References mpTemplateEntries.
|
private |
Obtain the root folder of the template folder hierarchy.
The result is stored in mxTemplateRoot for later use.
Definition at line 122 of file TemplateScanner.cxx.
References INITIALIZE_FOLDER_SCANNING, and mxTemplateRoot.
Referenced by RunNextStep().
|
overridevirtual |
Implementation of the AsynchronousTask interface method.
Implements sd::tools::AsynchronousTask.
Definition at line 328 of file TemplateScanner.cxx.
|
private |
Initialize the scanning of entries of a top-level folder.
Definition at line 131 of file TemplateScanner.cxx.
References ucbhelper::Content::createCursor(), ERROR, ucbhelper::Content::isFolder(), maFolderContent, mxEntryEnvironment, mxEntryResultSet, and SCAN_ENTRY.
Referenced by RunNextStep().
|
private |
Initialize the scanning of folders.
This is called exactly once.
Definition at line 199 of file TemplateScanner.cxx.
References ucbhelper::Content::createCursor(), ERROR, GATHER_FOLDER_LIST, comphelper::getProcessComponentContext(), mxFolderEnvironment, mxFolderResultSet, and mxTemplateRoot.
Referenced by RunNextStep().
|
overridevirtual |
Implementation of the AsynchronousTask interface method.
Implements sd::tools::AsynchronousTask.
Definition at line 282 of file TemplateScanner.cxx.
References DONE, ERROR, GATHER_FOLDER_LIST, GatherFolderList(), GetTemplateRoot(), INITIALIZE_ENTRY_SCAN, INITIALIZE_FOLDER_SCANNING, INITIALIZE_SCANNING, InitializeEntryScanning(), InitializeFolderScanning(), meState, mxEntryEnvironment, mxEntryResultSet, mxFolderEnvironment, mxFolderResultSet, mxTemplateRoot, SCAN_ENTRY, SCAN_FOLDER, ScanEntry(), and ScanFolder().
|
private |
Scan one entry.
When this entry matches the recognized template types it is appended to the result set.
Definition at line 150 of file TemplateScanner.cxx.
References SfxDocumentTemplates::ConvertResourceString(), ERROR, comphelper::getProcessComponentContext(), ucbhelper::Content::isDocument(), MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII, MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII, MIMETYPE_VND_SUN_XML_IMPRESS_ASCII, mpTemplateEntries, mxEntryEnvironment, mxEntryResultSet, SCAN_ENTRY, and SCAN_FOLDER.
Referenced by RunNextStep().
|
private |
From the list of top-level folders collected by GatherFolderList() the one with highest priority is processed.
Definition at line 253 of file TemplateScanner.cxx.
References DONE, ERROR, comphelper::getProcessComponentContext(), INITIALIZE_ENTRY_SCAN, ucbhelper::Content::isFolder(), maFolderContent, mpFolderDescriptors, and mpTemplateEntries.
Referenced by RunNextStep().
|
private |
Definition at line 117 of file TemplateScanner.hxx.
Referenced by InitializeEntryScanning(), and ScanFolder().
|
private |
Definition at line 115 of file TemplateScanner.hxx.
Referenced by HasNextStep(), and RunNextStep().
|
private |
Definition at line 123 of file TemplateScanner.hxx.
Referenced by GatherFolderList(), and ScanFolder().
|
private |
Definition at line 118 of file TemplateScanner.hxx.
Referenced by GetLastAddedEntry(), ScanEntry(), and ScanFolder().
|
private |
Definition at line 131 of file TemplateScanner.hxx.
Referenced by InitializeEntryScanning(), RunNextStep(), and ScanEntry().
|
private |
Definition at line 133 of file TemplateScanner.hxx.
Referenced by InitializeEntryScanning(), RunNextStep(), and ScanEntry().
|
private |
Definition at line 130 of file TemplateScanner.hxx.
Referenced by GatherFolderList(), InitializeFolderScanning(), and RunNextStep().
|
private |
Definition at line 132 of file TemplateScanner.hxx.
Referenced by GatherFolderList(), InitializeFolderScanning(), and RunNextStep().
|
private |
Set of state variables used by the methods InitializeFolderScanning(), GatherFolderList(), ScanFolder(), InitializeEntryScanning(), and ScanEntry().
Definition at line 129 of file TemplateScanner.hxx.
Referenced by GetTemplateRoot(), InitializeFolderScanning(), and RunNextStep().