1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: MasterPageContainerFiller.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SD_TOOLPANEL_CONTROLS_MASTER_PAGE_CONTAINER_FILLER_HXX
32 #define SD_TOOLPANEL_CONTROLS_MASTER_PAGE_CONTAINER_FILLER_HXX
34 #include "MasterPageContainer.hxx"
35 #include "MasterPageDescriptor.hxx"
36 #include "tools/AsynchronousTask.hxx"
39 class TemplateScanner
;
43 namespace sd
{ namespace toolpanel
{ namespace controls
{
45 /** Fill a MasterPageContainer with information about the available master
46 pages. These are provided by one default page and from the existing
47 Impress templates. This is done asynchronously.
49 class MasterPageContainerFiller
50 : public ::sd::tools::AsynchronousTask
53 class ContainerAdapter
56 virtual MasterPageContainer::Token
PutMasterPage (
57 const SharedMasterPageDescriptor
& rpDescriptor
) = 0;
58 /** This method is called when all Impress templates have been added
59 to the container via the PutMasterPage() method.
61 virtual void FillingDone (void) = 0;
64 MasterPageContainerFiller (ContainerAdapter
& rContainerAdapter
);
65 virtual ~MasterPageContainerFiller (void);
67 /** Run the next step of the task. After HasNextStep() returns false
68 this method should ignore further calls.
70 virtual void RunNextStep (void);
72 /** Return <TRUE/> when there is at least one more step to execute.
73 When the task has been executed completely then <FALSE/> is
76 virtual bool HasNextStep (void);
79 ContainerAdapter
& mrContainerAdapter
;
80 // Remember what the next step has to do.
82 INITIALIZE_TEMPLATE_SCANNER
,
88 ::std::auto_ptr
<TemplateScanner
> mpScannerTask
;
89 const TemplateEntry
* mpLastAddedEntry
;
92 State
ScanTemplate (void);
93 State
AddTemplate (void);
96 } } } // end of namespace ::sd::toolpanel::controls