Line data Source code
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 "svx/XPropertyTable.hxx"
21 :
22 : #include <vcl/virdev.hxx>
23 : #include <svl/itemset.hxx>
24 : #include <sfx2/docfile.hxx>
25 : #include <svx/dialogs.hrc>
26 : #include <svx/dialmgr.hxx>
27 : #include <svx/xtable.hxx>
28 : #include <svx/xpool.hxx>
29 : #include <svx/xbtmpit.hxx>
30 :
31 : using namespace com::sun::star;
32 :
33 0 : XBitmapEntry* XBitmapList::Remove(long nIndex)
34 : {
35 0 : return static_cast<XBitmapEntry*>( XPropertyList::Remove(nIndex) );
36 : }
37 :
38 0 : XBitmapEntry* XBitmapList::GetBitmap(long nIndex) const
39 : {
40 0 : return static_cast<XBitmapEntry*>( XPropertyList::Get(nIndex) );
41 : }
42 :
43 64 : uno::Reference< container::XNameContainer > XBitmapList::createInstance()
44 : {
45 : return uno::Reference< container::XNameContainer >(
46 64 : SvxUnoXBitmapTable_createInstance( this ), uno::UNO_QUERY );
47 : }
48 :
49 0 : bool XBitmapList::Create()
50 : {
51 0 : OUStringBuffer aStr(SVX_RESSTR(RID_SVXSTR_BITMAP));
52 : sal_uInt16 aArray[64];
53 0 : Bitmap aBitmap;
54 0 : const sal_Int32 nLen(aStr.getLength() - 1);
55 :
56 0 : memset(aArray, 0, sizeof(aArray));
57 :
58 : // white/white bitmap
59 0 : aStr.append(" 1");
60 0 : aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_WHITE), RGB_Color(COL_WHITE));
61 0 : Insert(new XBitmapEntry(Graphic(aBitmap), aStr.toString()));
62 :
63 : // black/white bitmap
64 0 : aArray[ 0] = 1; aArray[ 9] = 1; aArray[18] = 1; aArray[27] = 1;
65 0 : aArray[36] = 1; aArray[45] = 1; aArray[54] = 1; aArray[63] = 1;
66 0 : aStr[nLen] = '2';
67 0 : aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_BLACK), RGB_Color(COL_WHITE));
68 0 : Insert(new XBitmapEntry(Graphic(aBitmap), aStr.toString()));
69 :
70 : // lightred/white bitmap
71 0 : aArray[ 7] = 1; aArray[14] = 1; aArray[21] = 1; aArray[28] = 1;
72 0 : aArray[35] = 1; aArray[42] = 1; aArray[49] = 1; aArray[56] = 1;
73 0 : aStr[nLen] = '3';
74 0 : aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_LIGHTRED), RGB_Color(COL_WHITE));
75 0 : Insert(new XBitmapEntry(Graphic(aBitmap), aStr.toString()));
76 :
77 : // lightblue/white bitmap
78 0 : aArray[24] = 1; aArray[25] = 1; aArray[26] = 1;
79 0 : aArray[29] = 1; aArray[30] = 1; aArray[31] = 1;
80 0 : aStr[nLen] = '4';
81 0 : aBitmap = createHistorical8x8FromArray(aArray, RGB_Color(COL_LIGHTBLUE), RGB_Color(COL_WHITE));
82 0 : Insert(new XBitmapEntry(Graphic(aBitmap), aStr.toString()));
83 :
84 0 : return true;
85 : }
86 :
87 0 : Bitmap XBitmapList::CreateBitmapForUI( long /*nIndex*/ )
88 : {
89 0 : return Bitmap();
90 : }
91 :
92 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|