1*46dbaceeSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*46dbaceeSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*46dbaceeSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*46dbaceeSAndrew Rist  * distributed with this work for additional information
6*46dbaceeSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*46dbaceeSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*46dbaceeSAndrew Rist  * "License"); you may not use this file except in compliance
9*46dbaceeSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*46dbaceeSAndrew Rist  *
11*46dbaceeSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*46dbaceeSAndrew Rist  *
13*46dbaceeSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*46dbaceeSAndrew Rist  * software distributed under the License is distributed on an
15*46dbaceeSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*46dbaceeSAndrew Rist  * KIND, either express or implied.  See the License for the
17*46dbaceeSAndrew Rist  * specific language governing permissions and limitations
18*46dbaceeSAndrew Rist  * under the License.
19*46dbaceeSAndrew Rist  *
20*46dbaceeSAndrew Rist  *************************************************************/
21*46dbaceeSAndrew Rist 
22*46dbaceeSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _UPDATE_INFO_INCLUDED_
25cdf0e10cSrcweir #define _UPDATE_INFO_INCLUDED_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <rtl/ustring.hxx>
28cdf0e10cSrcweir #include <vector>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir struct DownloadSource
31cdf0e10cSrcweir {
32cdf0e10cSrcweir     bool IsDirect;
33cdf0e10cSrcweir     rtl::OUString URL;
34cdf0e10cSrcweir 
DownloadSourceDownloadSource35cdf0e10cSrcweir     DownloadSource(bool bIsDirect, const rtl::OUString& aURL) : IsDirect(bIsDirect), URL(aURL) {};
DownloadSourceDownloadSource36cdf0e10cSrcweir     DownloadSource(const DownloadSource& ds) : IsDirect(ds.IsDirect), URL(ds.URL) {};
37cdf0e10cSrcweir 
operator =DownloadSource38cdf0e10cSrcweir     DownloadSource & operator=( const DownloadSource & ds ) { IsDirect = ds.IsDirect; URL = ds.URL; return *this; };
39cdf0e10cSrcweir };
40cdf0e10cSrcweir 
41cdf0e10cSrcweir struct ReleaseNote
42cdf0e10cSrcweir {
43cdf0e10cSrcweir     sal_uInt8 Pos;
44cdf0e10cSrcweir     rtl::OUString URL;
45cdf0e10cSrcweir     sal_uInt8 Pos2;
46cdf0e10cSrcweir     rtl::OUString URL2;
47cdf0e10cSrcweir 
ReleaseNoteReleaseNote48cdf0e10cSrcweir     ReleaseNote(sal_uInt8 pos, const rtl::OUString aURL) : Pos(pos), URL(aURL), Pos2(0), URL2() {};
ReleaseNoteReleaseNote49cdf0e10cSrcweir     ReleaseNote(sal_uInt8 pos, const rtl::OUString aURL, sal_uInt8 pos2, const rtl::OUString aURL2) : Pos(pos), URL(aURL), Pos2(pos2), URL2(aURL2) {};
50cdf0e10cSrcweir 
ReleaseNoteReleaseNote51cdf0e10cSrcweir     ReleaseNote(const ReleaseNote& rn) :Pos(rn.Pos), URL(rn.URL), Pos2(rn.Pos2), URL2(rn.URL2) {};
operator =ReleaseNote52cdf0e10cSrcweir     ReleaseNote & operator=( const ReleaseNote& rn) { Pos=rn.Pos; URL=rn.URL; Pos2=rn.Pos2; URL2=rn.URL2; return *this; };
53cdf0e10cSrcweir };
54cdf0e10cSrcweir 
55cdf0e10cSrcweir struct UpdateInfo
56cdf0e10cSrcweir {
57cdf0e10cSrcweir     rtl::OUString BuildId;
58cdf0e10cSrcweir     rtl::OUString Version;
59cdf0e10cSrcweir     rtl::OUString Description;
60cdf0e10cSrcweir     std::vector< DownloadSource > Sources;
61cdf0e10cSrcweir     std::vector< ReleaseNote > ReleaseNotes;
62cdf0e10cSrcweir 
UpdateInfoUpdateInfo63cdf0e10cSrcweir     UpdateInfo() : BuildId(), Version(), Description(), Sources(), ReleaseNotes() {};
UpdateInfoUpdateInfo64cdf0e10cSrcweir     UpdateInfo(const UpdateInfo& ui) : BuildId(ui.BuildId), Version(ui.Version), Description(ui.Description), Sources(ui.Sources), ReleaseNotes(ui.ReleaseNotes) {};
65cdf0e10cSrcweir     inline UpdateInfo & operator=( const UpdateInfo& ui );
66cdf0e10cSrcweir };
67cdf0e10cSrcweir 
operator =(const UpdateInfo & ui)68cdf0e10cSrcweir UpdateInfo & UpdateInfo::operator=( const UpdateInfo& ui )
69cdf0e10cSrcweir {
70cdf0e10cSrcweir     BuildId = ui.BuildId;
71cdf0e10cSrcweir     Version = ui.Version;
72cdf0e10cSrcweir     Description = ui.Description;
73cdf0e10cSrcweir     Sources = ui.Sources;
74cdf0e10cSrcweir     ReleaseNotes = ui.ReleaseNotes;
75cdf0e10cSrcweir     return *this;
76cdf0e10cSrcweir }
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 
79cdf0e10cSrcweir // Returns the URL of the release note for the given position
80cdf0e10cSrcweir rtl::OUString getReleaseNote(const UpdateInfo& rInfo, sal_uInt8 pos, bool autoDownloadEnabled=false);
81cdf0e10cSrcweir 
82cdf0e10cSrcweir #endif
83