Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
5f0613b8
Kaydet (Commit)
5f0613b8
authored
Nis 29, 2014
tarafından
Rachit Gupta
Kaydeden (comit)
Jan Holesovsky
Agu 14, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Created basic architecture for PersonasDocHandler.
Change-Id: Ic1454344756c48090ebe821799d10dd6ace0264c
üst
3078f0e3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
178 additions
and
11 deletions
+178
-11
Library_cui.mk
cui/Library_cui.mk
+1
-0
personalization.cxx
cui/source/options/personalization.cxx
+27
-11
personasdochandler.cxx
cui/source/options/personasdochandler.cxx
+83
-0
personasdochandler.hxx
cui/source/options/personasdochandler.hxx
+67
-0
No files found.
cui/Library_cui.mk
Dosyayı görüntüle @
5f0613b8
...
...
@@ -157,6 +157,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
cui/source/options/optsave \
cui/source/options/optupdt \
cui/source/options/personalization \
cui/source/options/personasdochandler \
cui/source/options/radiobtnbox \
cui/source/options/sdbcdriverenum \
cui/source/options/securityoptions \
...
...
cui/source/options/personalization.cxx
Dosyayı görüntüle @
5f0613b8
...
...
@@ -10,6 +10,7 @@
#include <config_folders.h>
#include "personalization.hxx"
#include "personasdochandler.hxx"
#include <comphelper/processfactory.hxx>
#include <officecfg/Office/Common.hxx>
...
...
@@ -21,18 +22,15 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/system/SystemShellExecute.hpp>
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/FilePicker.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
#include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/xml/sax/Parser.hpp>
#include "ucbhelper/content.hxx"
using
namespace
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
ucb
;
/** Dialog that will allow the user to choose a Persona to use.
...
...
@@ -78,10 +76,28 @@ OUString SelectPersonaDialog::GetPersonaURL() const
IMPL_LINK
(
SelectPersonaDialog
,
VisitPersonas
,
PushButton
*
,
/*pButton*/
)
{
uno
::
Reference
<
com
::
sun
::
star
::
system
::
XSystemShellExecute
>
xSystemShell
(
com
::
sun
::
star
::
system
::
SystemShellExecute
::
create
(
::
comphelper
::
getProcessComponentContext
()
)
);
//
uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShell( com::sun::star::system::SystemShellExecute::create( ::comphelper::getProcessComponentContext() ) );
xSystemShell
->
execute
(
"https://addons.mozilla.org/firefox/themes/"
,
OUString
(),
com
::
sun
::
star
::
system
::
SystemShellExecuteFlags
::
URIS_ONLY
);
// xSystemShell->execute( "https://addons.mozilla.org/firefox/themes/", OUString(), com::sun::star::system::SystemShellExecuteFlags::URIS_ONLY );
Reference
<
XComponentContext
>
xContext
(
::
comphelper
::
getProcessComponentContext
()
);
Reference
<
xml
::
sax
::
XParser
>
xParser
=
xml
::
sax
::
Parser
::
create
(
xContext
);
PersonasDocHandler
*
pHandler
=
new
PersonasDocHandler
();
Reference
<
xml
::
sax
::
XDocumentHandler
>
xDocHandler
=
pHandler
;
uno
::
Reference
<
ucb
::
XSimpleFileAccess3
>
xFileAccess
(
ucb
::
SimpleFileAccess
::
create
(
comphelper
::
getProcessComponentContext
()
),
uno
::
UNO_QUERY
);
xParser
->
setDocumentHandler
(
xDocHandler
);
OUString
rURL
=
"file:////home/rachit/test.xml"
;
Reference
<
io
::
XInputStream
>
xStream
;
try
{
xStream
=
xFileAccess
->
openFileRead
(
rURL
);
}
catch
(...)
{
return
false
;
}
xml
::
sax
::
InputSource
aParserInput
;
aParserInput
.
aInputStream
=
xStream
;
xParser
->
parseStream
(
aParserInput
);
return
0
;
}
...
...
cui/source/options/personasdochandler.cxx
0 → 100644
Dosyayı görüntüle @
5f0613b8
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "personasdochandler.hxx"
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
// XDocumentHandler
void
SAL_CALL
PersonasDocHandler
::
startDocument
()
throw
(
xml
::
sax
::
SAXException
,
RuntimeException
,
std
::
exception
)
{
}
void
SAL_CALL
PersonasDocHandler
::
endDocument
()
throw
(
xml
::
sax
::
SAXException
,
RuntimeException
,
std
::
exception
)
{
}
void
SAL_CALL
PersonasDocHandler
::
characters
(
const
OUString
&
)
throw
(
xml
::
sax
::
SAXException
,
RuntimeException
,
std
::
exception
)
{
}
void
SAL_CALL
PersonasDocHandler
::
ignorableWhitespace
(
const
OUString
&
)
throw
(
xml
::
sax
::
SAXException
,
RuntimeException
,
std
::
exception
)
{
}
void
SAL_CALL
PersonasDocHandler
::
processingInstruction
(
const
OUString
&
,
const
OUString
&
)
throw
(
xml
::
sax
::
SAXException
,
RuntimeException
,
std
::
exception
)
{
}
void
SAL_CALL
PersonasDocHandler
::
setDocumentLocator
(
const
Reference
<
xml
::
sax
::
XLocator
>&
)
throw
(
xml
::
sax
::
SAXException
,
RuntimeException
,
std
::
exception
)
{
}
void
SAL_CALL
PersonasDocHandler
::
startElement
(
const
OUString
&
aName
,
const
Reference
<
xml
::
sax
::
XAttributeList
>
&
xAttribs
)
throw
(
xml
::
sax
::
SAXException
,
RuntimeException
,
std
::
exception
)
{
SAL_DEBUG
(
"startElement: "
<<
aName
<<
"
\n
"
);
for
(
sal_Int16
i
=
0
;
i
<
xAttribs
->
getLength
();
++
i
)
{
SAL_DEBUG
(
"
\t\t
Attribute Name: "
<<
xAttribs
->
getNameByIndex
(
i
)
<<
"
\t
Attribute Value: "
<<
xAttribs
->
getValueByIndex
(
i
)
<<
"
\n
"
);
}
}
void
SAL_CALL
PersonasDocHandler
::
endElement
(
const
OUString
&
aName
)
throw
(
xml
::
sax
::
SAXException
,
RuntimeException
,
std
::
exception
)
{
SAL_DEBUG
(
"endElement: "
<<
aName
<<
"
\n
"
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
cui/source/options/personasdochandler.hxx
0 → 100644
Dosyayı görüntüle @
5f0613b8
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/xml/sax/XParser.hpp>
class
PersonasDocHandler
:
public
::
cppu
::
WeakImplHelper1
<
css
::
xml
::
sax
::
XDocumentHandler
>
{
private
:
OUString
m_sHeaderURL
;
OUString
m_sFooterURL
;
OUString
m_sTextColor
;
OUString
m_sAccentColor
;
public
:
PersonasDocHandler
(){}
OUString
getHeaderURL
()
{
return
m_sHeaderURL
;
}
OUString
getFooterURL
()
{
return
m_sFooterURL
;
}
OUString
getTextColor
()
{
return
m_sTextColor
;
}
OUString
getAccentColor
()
{
return
m_sAccentColor
;
}
// XDocumentHandler
virtual
void
SAL_CALL
startDocument
()
throw
(
css
::
xml
::
sax
::
SAXException
,
css
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
endDocument
()
throw
(
css
::
xml
::
sax
::
SAXException
,
css
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
startElement
(
const
OUString
&
aName
,
const
css
::
uno
::
Reference
<
css
::
xml
::
sax
::
XAttributeList
>
&
xAttribs
)
throw
(
css
::
xml
::
sax
::
SAXException
,
css
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
endElement
(
const
OUString
&
aName
)
throw
(
css
::
xml
::
sax
::
SAXException
,
css
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
characters
(
const
OUString
&
aChars
)
throw
(
css
::
xml
::
sax
::
SAXException
,
css
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
ignorableWhitespace
(
const
OUString
&
aWhitespaces
)
throw
(
css
::
xml
::
sax
::
SAXException
,
css
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
processingInstruction
(
const
OUString
&
aTarget
,
const
OUString
&
aData
)
throw
(
css
::
xml
::
sax
::
SAXException
,
css
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
virtual
void
SAL_CALL
setDocumentLocator
(
const
css
::
uno
::
Reference
<
css
::
xml
::
sax
::
XLocator
>&
xLocator
)
throw
(
css
::
xml
::
sax
::
SAXException
,
css
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment