xref: /AOO41X/main/autodoc/inc/ary/actions.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef ARY_ACTIONS_HXX
29 #define ARY_ACTIONS_HXX
30 //  KORR_DEPRECATED_3.0
31 
32 
33 // USED SERVICES
34     // BASE CLASSES
35     // COMPONENTS
36     // PARAMETERS
37 
38 
39 namespace ary
40 {
41     class RepositoryCenter;
42 
43 
44 /*
45 enum E_Action
46 {
47     action_Parse,
48     action_SecondaryProductions,
49     action_Save,
50     action_Load,
51     action_ReadyForRead
52 };
53 */
54 
55 
56 /** @resp
57     Performs such commands on the repository, which refer to
58     large parts of it.
59 
60     @collab ::ary::Repository
61             and its components and derivates.
62     @descr
63     This class works in kind of double dispatch way:
64 
65     // Client code:
66     Command_Xy  aMyCommand;
67     ary::Repository::The_().PerformCommand( aMyCommand );
68 
69     // Repository_Implementation::PerformCommand() code:
70     aMyCommand.Run(*this);
71 
72     // Command_Xy::Run(Repository_Implementation & rRepository) code:
73     rRepository.Run_Command_Xy(*this);
74 */
75 class Command
76 {
77   public:
78     virtual             ~Command() {}
79 
80     void                Run(
81                             n22::RepositoryCenter &
82                                                 io_rReposy );
83   private:
84     virtual void        do_Run(
85                             n22::RepositoryCenter &
86                                                 io_rReposy ) = 0;
87 };
88 
89 
90 // IMPLEMENTATION
91 
92 inline void
93 Command::Run(n22::RepositoryCenter & io_rReposy)
94     { do_Run(io_rReposy); }
95 
96 
97 } // namespace ary
98 
99 
100 #endif
101 
102 
103 
104