LibreOffice Module embedserv (master) 1
guid.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 <common.h>
21#include <com/sun/star/lang/XMultiServiceFactory.hpp>
22#include <com/sun/star/container/XNameAccess.hpp>
23
24#include "guid.hxx"
25
26wchar_t const * getStorageTypeFromGUID_Impl( GUID const * guid )
27{
28 if ( *guid == OID_WriterTextServer )
29 return L"soffice.StarWriterDocument.6";
30
31 if ( *guid == OID_WriterOASISTextServer )
32 return L"LibreOffice.WriterDocument.1";
33
34 if ( *guid == OID_CalcServer )
35 return L"soffice.StarCalcDocument.6";
36
37 if ( *guid == OID_CalcOASISServer )
38 return L"LibreOffice.CalcDocument.1";
39
40 if ( *guid == OID_DrawingServer )
41 return L"soffice.StarDrawDocument.6";
42
43 if ( *guid == OID_DrawingOASISServer )
44 return L"LibreOffice.DrawDocument.1";
45
46 if ( *guid == OID_PresentationServer )
47 return L"soffice.StarImpressDocument.6";
48
49 if ( *guid == OID_PresentationOASISServer )
50 return L"LibreOffice.ImpressDocument.1";
51
52 if ( *guid == OID_MathServer )
53 return L"soffice.StarMathDocument.6";
54
55 if ( *guid == OID_MathOASISServer )
56 return L"LibreOffice.MathDocument.1";
57
58 return L"";
59}
60
61std::u16string_view getServiceNameFromGUID_Impl( GUID const * guid )
62{
63 if ( *guid == OID_WriterTextServer )
64 return u"com.sun.star.comp.Writer.TextDocument";
65
66 if ( *guid == OID_WriterOASISTextServer )
67 return u"com.sun.star.comp.Writer.TextDocument";
68
69 if ( *guid == OID_CalcServer )
70 return u"com.sun.star.comp.Calc.SpreadsheetDocument";
71
72 if ( *guid == OID_CalcOASISServer )
73 return u"com.sun.star.comp.Calc.SpreadsheetDocument";
74
75 if ( *guid == OID_DrawingServer )
76 return u"com.sun.star.comp.Draw.DrawingDocument";
77
78 if ( *guid == OID_DrawingOASISServer )
79 return u"com.sun.star.comp.Draw.DrawingDocument";
80
81 if ( *guid == OID_PresentationServer )
82 return u"com.sun.star.comp.Draw.PresentationDocument";
83
84 if ( *guid == OID_PresentationOASISServer )
85 return u"com.sun.star.comp.Draw.PresentationDocument";
86
87 if ( *guid == OID_MathServer )
88 return u"com.sun.star.comp.Math.FormulaDocument";
89
90 if ( *guid == OID_MathOASISServer )
91 return u"com.sun.star.comp.Math.FormulaDocument";
92
93 return u"";
94}
95
96OUString getFilterNameFromGUID_Impl( GUID const * guid )
97{
98 if ( *guid == OID_WriterTextServer )
99 return "StarOffice XML (Writer)";
100
101 if ( *guid == OID_WriterOASISTextServer )
102 return "writer8";
103
104 if ( *guid == OID_CalcServer )
105 return "StarOffice XML (Calc)";
106
107 if ( *guid == OID_CalcOASISServer )
108 return "calc8";
109
110 if ( *guid == OID_DrawingServer )
111 return "StarOffice XML (Draw)";
112
113 if ( *guid == OID_DrawingOASISServer )
114 return "draw8";
115
116 if ( *guid == OID_PresentationServer )
117 return "StarOffice XML (Impress)";
118
119 if ( *guid == OID_PresentationOASISServer )
120 return "impress8";
121
122 if ( *guid == OID_MathServer )
123 return "StarOffice XML (Math)";
124
125 if ( *guid == OID_MathOASISServer )
126 return "math8";
127
128 return OUString();
129}
130
131/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
float u
const GUID DECLSPEC_SELECTANY OID_PresentationServer
Definition: embservconst.h:39
const GUID DECLSPEC_SELECTANY OID_MathServer
Definition: embservconst.h:43
const GUID DECLSPEC_SELECTANY OID_DrawingServer
Definition: embservconst.h:35
const GUID DECLSPEC_SELECTANY OID_CalcServer
Definition: embservconst.h:32
const GUID DECLSPEC_SELECTANY OID_MathOASISServer
Definition: embservconst.h:44
const GUID DECLSPEC_SELECTANY OID_WriterTextServer
Definition: embservconst.h:29
const GUID DECLSPEC_SELECTANY OID_WriterOASISTextServer
Definition: embservconst.h:30
const GUID DECLSPEC_SELECTANY OID_CalcOASISServer
Definition: embservconst.h:33
const GUID DECLSPEC_SELECTANY OID_DrawingOASISServer
Definition: embservconst.h:36
const GUID DECLSPEC_SELECTANY OID_PresentationOASISServer
Definition: embservconst.h:41
wchar_t const * getStorageTypeFromGUID_Impl(GUID const *guid)
Definition: guid.cxx:26
std::u16string_view getServiceNameFromGUID_Impl(GUID const *guid)
Definition: guid.cxx:61
OUString getFilterNameFromGUID_Impl(GUID const *guid)
Definition: guid.cxx:96