LibreOffice Module framework (master) 1
jobresult.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 <jobs/jobresult.hxx>
21#include <jobs/jobconst.hxx>
22
23#include <vcl/svapp.hxx>
26
27namespace framework
28{
72JobResult::JobResult(/*IN*/ const css::uno::Any& aResult)
73{
74 // reset the flag mask!
75 // It will reset the accessible state of this object.
76 // That can be useful if something will fail here ...
78
79 // analyze the result and update our other members
80 ::comphelper::SequenceAsHashMap aProtocol(aResult);
81 if (aProtocol.empty())
82 return;
83
86 if (pIt != aProtocol.end())
87 {
93 bool bDeactivate(false);
94 pIt->second >>= bDeactivate;
95 if (bDeactivate)
97 }
98
100 if (pIt != aProtocol.end())
101 {
102 css::uno::Sequence<css::beans::NamedValue> aTmp;
103 pIt->second >>= aTmp;
105 if (m_lArguments.empty())
107 }
108
110 if (pIt != aProtocol.end())
111 {
112 if (pIt->second >>= m_aDispatchResult)
114 }
115}
116
121{
122 m_eParts = rCopy.m_eParts;
125}
126
132{
133 // Nothing really to do here.
134}
135
144{
145 m_eParts = rCopy.m_eParts;
148 return *this;
149}
150
163bool JobResult::existPart(sal_uInt32 eParts) const { return ((m_eParts & eParts) == eParts); }
164
173std::vector<css::beans::NamedValue> JobResult::getArguments() const { return m_lArguments; }
174
175css::frame::DispatchResultEvent JobResult::getDispatchResult() const { return m_aDispatchResult; }
176
177} // namespace framework
178
179/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
iterator find(const OUString &rKey)
SequenceAsHashMapBase::const_iterator const_iterator
static constexpr OUStringLiteral ANSWER_SAVE_ARGUMENTS
Definition: jobconst.hxx:38
static constexpr OUStringLiteral ANSWER_SEND_DISPATCHRESULT
Definition: jobconst.hxx:39
static constexpr OUStringLiteral ANSWER_DEACTIVATE_JOB
Definition: jobconst.hxx:37
represent a result of a finished job execution @descr Such result instance transport all necessary da...
Definition: jobresult.hxx:36
~JobResult()
standard dtor @descr Free all internally used resources at the end of living.
Definition: jobresult.cxx:131
sal_uInt32 m_eParts
an user of us must know, which (possible) parts of a "pure result" was really set by an executed job.
Definition: jobresult.hxx:68
std::vector< css::beans::NamedValue > getArguments() const
provides access to our internal members @descr The return value will be valid only in case a call of ...
Definition: jobresult.cxx:173
JobResult(const css::uno::Any &aResult)
special ctor @descr It initialize this new instance with a pure job execution result and analyze it.
Definition: jobresult.cxx:72
JobResult & operator=(const JobResult &rCopy)
=operator @descr Must be implemented to overwrite this instance with another one.
Definition: jobresult.cxx:143
css::frame::DispatchResultEvent m_aDispatchResult
represent the part "DispatchResult" It's a fulfilled event type, which was given back by the executed...
Definition: jobresult.hxx:84
bool existPart(sal_uInt32 eParts) const
checks for existing parts of the analyzed result @descr The internal flag mask was set after analyzin...
Definition: jobresult.cxx:163
std::vector< css::beans::NamedValue > m_lArguments
a job can have persistent data They are part of the pure result and will be used to write it to the c...
Definition: jobresult.hxx:76
css::frame::DispatchResultEvent getDispatchResult() const
Definition: jobresult.cxx:175
DstType sequenceToContainer(const css::uno::Sequence< SrcType > &i_Sequence)