1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include "svx/XPropertyTable.hxx"
23 #include <vcl/virdev.hxx>
24 #include <svl/itemset.hxx>
25 #include <sfx2/docfile.hxx>
26 #include <svx/dialogs.hrc>
27 #include <svx/dialmgr.hxx>
28 #include <svx/xtable.hxx>
29 #include <svx/xpool.hxx>
30 #include <svx/xbtmpit.hxx>
32 using namespace com::sun::star
;
34 XBitmapEntry
* XBitmapList::Remove(long nIndex
)
36 return (XBitmapEntry
*) XPropertyList::Remove(nIndex
);
39 XBitmapEntry
* XBitmapList::GetBitmap(long nIndex
) const
41 return (XBitmapEntry
*) XPropertyList::Get(nIndex
, 0);
44 uno::Reference
< container::XNameContainer
> XBitmapList::createInstance()
46 return uno::Reference
< container::XNameContainer
>(
47 SvxUnoXBitmapTable_createInstance( this ), uno::UNO_QUERY
);
50 sal_Bool
XBitmapList::Create()
52 //-----------------------
53 // 00 01 02 03 04 05 06 07
54 // 08 09 10 11 12 13 14 15
55 // 16 17 18 19 20 21 22 23
56 // 24 25 26 27 28 29 30 31
57 // 32 33 34 35 36 37 38 39
58 // 40 41 42 43 44 45 46 47
59 // 48 49 50 51 52 53 54 55
60 // 56 57 58 59 60 61 62 63
61 String
aStr(SVX_RES(RID_SVXSTR_BITMAP
));
62 sal_uInt16 aArray
[64];
64 const xub_StrLen
nLen(aStr
.Len() - 1);
66 memset(aArray
, 0, sizeof(aArray
));
69 aStr
.AppendAscii(" 1");
70 aBitmap
= createHistorical8x8FromArray(aArray
, RGB_Color(COL_WHITE
), RGB_Color(COL_WHITE
));
71 Insert(new XBitmapEntry(Graphic(aBitmap
), aStr
));
74 aArray
[ 0] = 1; aArray
[ 9] = 1; aArray
[18] = 1; aArray
[27] = 1;
75 aArray
[36] = 1; aArray
[45] = 1; aArray
[54] = 1; aArray
[63] = 1;
76 aStr
.SetChar(nLen
, sal_Unicode('2'));
77 aBitmap
= createHistorical8x8FromArray(aArray
, RGB_Color(COL_BLACK
), RGB_Color(COL_WHITE
));
78 Insert(new XBitmapEntry(Graphic(aBitmap
), aStr
));
80 // lightred/white bitmap
81 aArray
[ 7] = 1; aArray
[14] = 1; aArray
[21] = 1; aArray
[28] = 1;
82 aArray
[35] = 1; aArray
[42] = 1; aArray
[49] = 1; aArray
[56] = 1;
83 aStr
.SetChar(nLen
, sal_Unicode('3'));
84 aBitmap
= createHistorical8x8FromArray(aArray
, RGB_Color(COL_LIGHTRED
), RGB_Color(COL_WHITE
));
85 Insert(new XBitmapEntry(Graphic(aBitmap
), aStr
));
87 // lightblue/white bitmap
88 aArray
[24] = 1; aArray
[25] = 1; aArray
[26] = 1;
89 aArray
[29] = 1; aArray
[30] = 1; aArray
[31] = 1;
90 aStr
.SetChar(nLen
, sal_Unicode('4'));
91 aBitmap
= createHistorical8x8FromArray(aArray
, RGB_Color(COL_LIGHTBLUE
), RGB_Color(COL_WHITE
));
92 Insert(new XBitmapEntry(Graphic(aBitmap
), aStr
));
97 Bitmap
XBitmapList::CreateBitmapForUI( long /*nIndex*/ )
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */