LibreOffice Module xmloff (master)  1
controlelement.cxx
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 
20 #include "controlelement.hxx"
21 #include <xmloff/xmltoken.hxx>
22 
23 using namespace ::xmloff::token;
24 
25 namespace xmloff
26 {
27 
28  //= OControlElement
30  {
31  switch (_eType)
32  {
33  case TEXT: return "text";
34  case TEXT_AREA: return "textarea";
35  case PASSWORD: return "password";
36  case FILE: return "file";
37  case FORMATTED_TEXT: return "formatted-text";
38  case FIXED_TEXT: return "fixed-text";
39  case COMBOBOX: return "combobox";
40  case LISTBOX: return "listbox";
41  case BUTTON: return "button";
42  case IMAGE: return "image";
43  case CHECKBOX: return "checkbox";
44  case RADIO: return "radio";
45  case FRAME: return "frame";
46  case IMAGE_FRAME: return "image-frame";
47  case HIDDEN: return "hidden";
48  case GRID: return "grid";
49  case VALUERANGE: return "value-range";
50  case TIME: return "time";
51  case DATE: return "date";
52 
53  default: return "generic-control";
54  }
55  }
56 
58  {
59  switch (_eType)
60  {
61  case TEXT: return XML_TEXT;
62  case TEXT_AREA: return XML_TEXTAREA;
63  case PASSWORD: return XML_PASSWORD;
64  case FILE: return XML_FILE;
66  case FIXED_TEXT: return XML_FIXED_TEXT;
67  case COMBOBOX: return XML_COMBOBOX;
68  case LISTBOX: return XML_LISTBOX;
69  case BUTTON: return XML_BUTTON;
70  case IMAGE: return XML_IMAGE;
71  case CHECKBOX: return XML_CHECKBOX;
72  case RADIO: return XML_RADIO;
73  case FRAME: return XML_FRAME;
74  case IMAGE_FRAME: return XML_IMAGE_FRAME;
75  case HIDDEN: return XML_HIDDEN;
76  case GRID: return XML_GRID;
77  case VALUERANGE: return XML_VALUE_RANGE;
78  case TIME: return XML_TIME;
79  case DATE: return XML_DATE;
80 
81  default: return XML_GENERIC_CONTROL;
82  }
83  }
84 
85 } // namespace xmloff
86 
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static sal_Int32 getElementToken(ElementType _eType)
retrieves the tag name to be used to describe a control of the given type
static const char * getElementName(ElementType _eType)
retrieves the tag name to be used to describe a control of the given type
Handling of tokens in XML: