LibreOffice Module vcl (master)  1
EnumContext.hxx
Go to the documentation of this file.
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  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #ifndef INCLUDED_VCL_ENUMCONTEXT_HXX
20 #define INCLUDED_VCL_ENUMCONTEXT_HXX
21 
22 #include <vcl/dllapi.h>
23 
24 #include <rtl/ustring.hxx>
25 
26 
27 namespace vcl {
28 
30 {
31 public:
32  enum class Application
33  {
34  Writer,
35  WriterGlobal,
36  WriterWeb,
37  WriterXML,
38  WriterForm,
39  WriterReport,
40  Calc,
41  Chart,
42  Draw,
43  Impress,
44  Formula,
45  Base,
46 
47  // For your convenience to avoid duplicate code in the common
48  // case that Draw and Impress use identical context configurations.
50 
51  // Also for your convenience for the different variants of Writer documents.
52  WriterVariants,
53 
54  // Used only by deck or panel descriptors. Matches any
55  // application.
56  Any,
57 
58  // Use this only in special circumstances. One might be the
59  // wish to disable a deck or panel during debugging.
60  NONE,
61 
62  LAST = Application::NONE
63  };
64  enum class Context
65  {
66  ThreeDObject,
67  Annotation,
68  Auditing,
69  Axis,
70  Cell,
71  Chart,
72  ChartElements,
73  Draw,
74  DrawFontwork,
75  DrawLine,
76  DrawPage,
77  DrawText,
78  EditCell,
79  ErrorBar,
80  Form,
81  Frame,
82  Graphic,
83  Grid,
84  HandoutPage,
85  MasterPage,
86  Media,
87  MultiObject,
88  NotesPage,
89  OLE,
90  OutlineText,
91  Pivot,
92  Printpreview,
93  Series,
94  SlidesorterPage,
95  Table,
96  Text,
97  TextObject,
98  Trendline,
99 
100  // Default context of an application. Do we need this?
101  Default,
102 
103  // Used only by deck or panel descriptors. Matches any context.
104  Any,
105 
106  // Special context name that is only used when a deck would
107  // otherwise be empty.
108  Empty,
109 
110  Unknown,
111 
112  LAST = Unknown
113  };
114 
115  EnumContext();
116  EnumContext (
117  const Application eApplication,
118  const Context eContext);
119 
127  sal_Int32 GetCombinedContext_DI() const;
128 
129  Application GetApplication_DI() const;
130 
131  bool operator == (const EnumContext& rOther) const;
132  bool operator != (const EnumContext& rOther) const;
133 
139  const static sal_Int32 NoMatch;
140 
141  static Application GetApplicationEnum (const OUString& rsApplicationName);
142  static const OUString& GetApplicationName (const Application eApplication);
143 
144  static Context GetContextEnum (const OUString& rsContextName);
145  static const OUString& GetContextName (const Context eContext);
146 
147 private:
150 
151  static void ProvideApplicationContainers();
152  static void ProvideContextContainers();
153  static void AddEntry (const OUString& rsName, const Application eApplication);
154  static void AddEntry (const OUString& rsName, const Context eContext);
155 };
156 
157 
158 #define CombinedEnumContext(a,e) ((static_cast<sal_uInt16>(::vcl::EnumContext::a)<<16)\
159  | static_cast<sal_uInt16>(::vcl::EnumContext::e))
160 
161 } // end of namespace vcl
162 
163 #endif
164 
165 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool operator!=(const ItalicMatrix &a, const ItalicMatrix &b)
Definition: vclenum.hxx:209
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
Unknown
NONE
Application meApplication
bool operator==(const ItalicMatrix &a, const ItalicMatrix &b)
Definition: vclenum.hxx:204
void DrawLine(OutputDevice &rDev, const basegfx::B2DPoint &rP1, const basegfx::B2DPoint &rP2, sal_uInt32 nWidth, SvxBorderLineStyle nDashing)
Base
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:233
static const sal_Int32 NoMatch
When two contexts are matched against each other, then application or context name may have the wildc...
Empty