diff options
author | Björn Milcke <bm@openoffice.org> | 2003-10-06 08:58:36 +0000 |
---|---|---|
committer | Björn Milcke <bm@openoffice.org> | 2003-10-06 08:58:36 +0000 |
commit | 668c6b0245b6076ac8fb3f5d734795117188675e (patch) | |
tree | 363512534f7fae13719bddccb3a365e48ef7a8d3 /chart2/source | |
parent | 2ccbe3d78ecfa9aa1527db50d304a277d3cdbe64 (diff) |
initial import
Diffstat (limited to 'chart2/source')
249 files changed, 64996 insertions, 0 deletions
diff --git a/chart2/source/controller/controller.map b/chart2/source/controller/controller.map new file mode 100644 index 000000000000..d3ce9e89b559 --- /dev/null +++ b/chart2/source/controller/controller.map @@ -0,0 +1,9 @@ +UDK_3_0_0 { + global: + component_getImplementationEnvironment; + component_writeInfo; + component_getFactory; + component_getDescriptionFunc; + local: + *; +}; diff --git a/chart2/source/controller/dialogs/Bitmaps.hrc b/chart2/source/controller/dialogs/Bitmaps.hrc new file mode 100644 index 000000000000..9813b6d049d6 --- /dev/null +++ b/chart2/source/controller/dialogs/Bitmaps.hrc @@ -0,0 +1,202 @@ +/************************************************************************* + * + * $RCSfile: Bitmaps.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _SOLAR_HRC +#include <svtools/solar.hrc> +#endif + + //#define RID_APP_START 30000 +////#define RID_DRAW_TOOLBOX (RID_SCH_START + 1) +////#define RID_DRAW_OBJ_TOOLBOX (RID_APP_START + 10001) +////#define RID_STATUSBAR (RID_APP_START + 10002) + //#define RID_ALIGNMENT (RID_APP_START + 3) + //#define RID_ZOOM (RID_APP_START + 4) + //#define RID_CONTROLS (RID_APP_START + 5) + //#define RID_TEXT_TOOLBOX (RID_APP_START + 6) + +////#define RID_DOCWINDOW_ICON (RID_APP_START + 20) +////#define RID_DOCTEMPLATE_ICON (RID_APP_START + 21) + +// chart types +#define BMP_AREAS_2D (RID_APP_START + 34) +#define BMP_AREAS_2D_1 (RID_APP_START + 35) +#define BMP_AREAS_2D_3 (RID_APP_START + 36) +#define BMP_AREAS_3D (RID_APP_START + 61) +#define BMP_AREAS_3D_1 (RID_APP_START + 62) +#define BMP_AREAS_3D_2 (RID_APP_START + 63) + +#define BMP_BARS_2D (RID_APP_START + 41) +#define BMP_BARS_2D_1 (RID_APP_START + 42) +#define BMP_BARS_2D_2 (RID_APP_START + 43) +#define BMP_BARS_2D_3 (RID_APP_START + 44) +#define BMP_BARS_3D (RID_APP_START + 71) +#define BMP_BARS_3D_1 (RID_APP_START + 72) +#define BMP_BARS_3D_2 (RID_APP_START + 73) +#define BMP_BARS_3D_3 (RID_APP_START + 74) + +#define BMP_CIRCLES_2D (RID_APP_START + 45) +#define BMP_CIRCLES_2D_1 (RID_APP_START + 46) +#define BMP_CIRCLES_2D_2 (RID_APP_START + 47) +#define BMP_CIRCLES_3D (RID_APP_START + 68) + +#define BMP_COLUMNS_2D (RID_APP_START + 37) +#define BMP_COLUMNS_2D_1 (RID_APP_START + 38) +#define BMP_COLUMNS_2D_2 (RID_APP_START + 39) +#define BMP_COLUMNS_2D_3 (RID_APP_START + 40) +#define BMP_COLUMNS_2D_4 (RID_APP_START + 58) +#define BMP_COLUMNS_2D_5 (RID_APP_START + 98) +#define BMP_COLUMNS_3D (RID_APP_START + 64) +#define BMP_COLUMNS_3D_1 (RID_APP_START + 65) +#define BMP_COLUMNS_3D_2 (RID_APP_START + 66) +#define BMP_COLUMNS_3D_3 (RID_APP_START + 67) + +#define BMP_DONUT1_2D (RID_APP_START + 54) +//#define BMP_DONUT2_2D (RID_APP_START + 55) + +#define BMP_KEGELQ_3D_1 (RID_APP_START + 124) +#define BMP_KEGELQ_3D_2 (RID_APP_START + 125) +#define BMP_KEGELQ_3D_3 (RID_APP_START + 126) +#define BMP_KEGELQ_3D_4 (RID_APP_START + 127) +#define BMP_KEGEL_3D_1 (RID_APP_START + 120) +#define BMP_KEGEL_3D_2 (RID_APP_START + 121) +#define BMP_KEGEL_3D_3 (RID_APP_START + 122) +#define BMP_KEGEL_3D_4 (RID_APP_START + 123) + +//#define BMP_LINESYMB_2D (RID_APP_START + 50) +#define BMP_LINESYMB_2D_1 (RID_APP_START + 51) +#define BMP_LINESYMB_2D_2 (RID_APP_START + 52) +#define BMP_LINESYMB_2D_3 (RID_APP_START + 53) + +#define BMP_LINES_2D (RID_APP_START + 30) +#define BMP_LINES_2D_1 (RID_APP_START + 31) +#define BMP_LINES_2D_2 (RID_APP_START + 32) +#define BMP_LINES_2D_3 (RID_APP_START + 33) +#define BMP_LINES_3D (RID_APP_START + 60) + +#define BMP_NETSYMB_2D (RID_APP_START + 57) +#define BMP_NETSYMB_2D_STACK (RID_APP_START + 91) +#define BMP_NETSYMB_2D_PERCENT (RID_APP_START + 93) +#define BMP_NET_2D (RID_APP_START + 56) +#define BMP_NET_2D_STACK (RID_APP_START + 90) +#define BMP_NET_2D_PERCENT (RID_APP_START + 92) + +#define BMP_PYRAMIDQ_3D_1 (RID_APP_START + 116) +#define BMP_PYRAMIDQ_3D_2 (RID_APP_START + 117) +#define BMP_PYRAMIDQ_3D_3 (RID_APP_START + 118) +#define BMP_PYRAMIDQ_3D_4 (RID_APP_START + 119) + +#define BMP_PYRAMID_3D_1 (RID_APP_START + 112) +#define BMP_PYRAMID_3D_2 (RID_APP_START + 113) +#define BMP_PYRAMID_3D_3 (RID_APP_START + 114) +#define BMP_PYRAMID_3D_4 (RID_APP_START + 115) + +#define BMP_ROEHRE_3D_1 (RID_APP_START + 108) +#define BMP_ROEHRE_3D_2 (RID_APP_START + 109) +#define BMP_ROEHRE_3D_3 (RID_APP_START + 110) +#define BMP_ROEHRE_3D_4 (RID_APP_START + 111) + +#define BMP_SAEULE_3D_1 (RID_APP_START + 104) +#define BMP_SAEULE_3D_2 (RID_APP_START + 105) +#define BMP_SAEULE_3D_3 (RID_APP_START + 106) +#define BMP_SAEULE_3D_4 (RID_APP_START + 107) + +#define BMP_SPLINE_B (RID_APP_START + 96) +#define BMP_SPLINE_B_SYMBOL (RID_APP_START + 97) +#define BMP_SPLINE_CUBIC (RID_APP_START + 94) +#define BMP_SPLINE_CUBIC_SYMBOL (RID_APP_START + 95) + +#define BMP_STOCK_1 (RID_APP_START + 99) +#define BMP_STOCK_2 (RID_APP_START + 100) +#define BMP_STOCK_3 (RID_APP_START + 101) +#define BMP_STOCK_4 (RID_APP_START + 102) + +//#define BMP_SURF_3D (RID_APP_START + 59) +#define BMP_XYSYMB_2D (RID_APP_START + 49) +//#define BMP_XYZSYMB_3D (RID_APP_START + 70) +//#define BMP_XYZ_3D (RID_APP_START + 69) +#define BMP_XY_2D (RID_APP_START + 48) + + + +//SchStatisticTabPage and SchDataStatisticsDlg part 1 +#define BMP_INDICATE_NONE (RID_APP_START + 75) +#define BMP_INDICATE_BOTH (RID_APP_START + 76) +#define BMP_INDICATE_UP (RID_APP_START + 77) +#define BMP_INDICATE_DOWN (RID_APP_START + 78) + +/* +#define RID_ACCEL (RID_APP_START + 80) +#define RID_MENU (RID_APP_START + 81) +#define RID_PORTAL_MENU (RID_APP_START + 82) +*/ + +//SchStatisticTabPage and SchDataStatisticsDlg part 2 +#define BMP_REGRESSION_NONE (RID_APP_START + 85) +#define BMP_REGRESSION_LINEAR (RID_APP_START + 86) +#define BMP_REGRESSION_LOG (RID_APP_START + 87) +#define BMP_REGRESSION_EXP (RID_APP_START + 88) +#define BMP_REGRESSION_POWER (RID_APP_START + 89) + +// Popup-Menus +////#define RID_FORMAT_POPUP (RID_APP_START + 200) +////#define RID_3D_POPUP (RID_APP_START + 201) +////#define RID_3D_PIE_POPUP (RID_APP_START + 202) +////#define RID_2D_POPUP (RID_APP_START + 203) +////#define RID_2D_PIE_POPUP (RID_APP_START + 204) diff --git a/chart2/source/controller/dialogs/Bitmaps.src b/chart2/source/controller/dialogs/Bitmaps.src new file mode 100644 index 000000000000..973252fa18c8 --- /dev/null +++ b/chart2/source/controller/dialogs/Bitmaps.src @@ -0,0 +1,493 @@ +/************************************************************************* + * + * $RCSfile: Bitmaps.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Bitmaps.hrc" + +/* +#include "sfx2/sfx.hrc" +#include "svtools/style.hrc" +*/ +/* +SfxStyleFamilies DLG_STYLE_DESIGNER +{ + StyleFamilyList = + { + SfxStyleFamilyItem + { + StyleBitmap = Bitmap { File = "sco206.bmp" ; }; + Text = "Grafikobjektvorlagen" ; + Text [ ENGLISH ] = "Graphic Objects Styles" ; + Text [ english_us ] = "Graphics Styles" ; + Text [ italian ] = "Modelli di oggetti grafici" ; + Text [ spanish ] = "Estilos de objeto grfico" ; + Text [ french ] = "Styles d'objet graphique" ; + Text [ dutch ] = "Opmaakprofielen voor grafische objecten" ; + Text [ swedish ] = "Grafikobjektformatmallar" ; + Text [ danish ] = "Grafikobjekttypografier" ; + Text [ portuguese_brazilian ] = "Estilos de Figuras" ; + Text [ portuguese ] = "Modelos de objectos grficos" ; + Text[ chinese_simplified ] = "图形对象样式"; + Text[ russian ] = " "; + Text[ polish ] = "Style grafiki"; + Text[ japanese ] = "図オブジェクトスタイル"; + Text[ chinese_traditional ] = "圖形物件樣式"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "그림 스타일 "; + Text[ czech ] = "Grafické styly" ; + StyleFamily = SFX_STYLE_FAMILY_PARA ; + FilterList = + { + < STR_STYLE_FILTER_ALL ; SFXSTYLEBIT_ALL ; > ; + < STR_STYLE_FILTER_USED ; SFXSTYLEBIT_USED ; > ; + < STR_STYLE_FILTER_USERDEF ; SFXSTYLEBIT_USERDEF ; > ; + }; + }; + }; +}; +*/ + +Bitmap BMP_AREAS_2D +{ + File = "areas2d.bmp" ; +}; +Bitmap BMP_AREAS_2D_1 +{ + File = "areas2d1.bmp" ; +}; +Bitmap BMP_AREAS_2D_3 +{ + File = "areas2d3.bmp" ; +}; +Bitmap BMP_AREAS_3D +{ + File = "areas3d.bmp" ; +}; +Bitmap BMP_AREAS_3D_1 +{ + File = "areas3d1.bmp" ; +}; +Bitmap BMP_AREAS_3D_2 +{ + File = "areas3d2.bmp" ; +}; +//--------------------- +Bitmap BMP_BARS_2D +{ + File = "bars2d.bmp" ; +}; +Bitmap BMP_BARS_2D_1 +{ + File = "bars2d1.bmp" ; +}; +Bitmap BMP_BARS_2D_2 +{ + File = "bars2d2.bmp" ; +}; +Bitmap BMP_BARS_2D_3 +{ + File = "bars2d3.bmp" ; +}; +Bitmap BMP_BARS_3D +{ + File = "bars3d.bmp" ; +}; +Bitmap BMP_BARS_3D_1 +{ + File = "bars3d1.bmp" ; +}; +Bitmap BMP_BARS_3D_2 +{ + File = "bars3d2.bmp" ; +}; +Bitmap BMP_BARS_3D_3 +{ + File = "bars3d3.bmp" ; +}; +//--------------------- +Bitmap BMP_CIRCLES_2D +{ + File = "circl2d.bmp" ; +}; +Bitmap BMP_CIRCLES_2D_1 +{ + File = "circl2d1.bmp" ; +}; +Bitmap BMP_CIRCLES_2D_2 +{ + File = "circl2d2.bmp" ; +}; +Bitmap BMP_CIRCLES_3D +{ + File = "circl3d.bmp" ; +}; +//--------------------- +Bitmap BMP_COLUMNS_2D +{ + File = "cols2d.bmp" ; +}; +Bitmap BMP_COLUMNS_2D_1 +{ + File = "cols2d1.bmp" ; +}; +Bitmap BMP_COLUMNS_2D_2 +{ + File = "cols2d2.bmp" ; +}; +Bitmap BMP_COLUMNS_2D_3 +{ + File = "cols2d3.bmp" ; +}; +Bitmap BMP_COLUMNS_2D_4 +{ + File = "cols2d4.bmp" ; +}; +Bitmap BMP_COLUMNS_2D_5 +{ + File = "cols2d5.bmp" ; +}; +//--------------------- +Bitmap BMP_COLUMNS_3D +{ + File = "cols3d.bmp" ; +}; +Bitmap BMP_COLUMNS_3D_1 +{ + File = "cols3d1.bmp" ; +}; +Bitmap BMP_COLUMNS_3D_2 +{ + File = "cols3d2.bmp" ; +}; +Bitmap BMP_COLUMNS_3D_3 +{ + File = "cols3d3.bmp" ; +}; +//--------------------- +Bitmap BMP_DONUT1_2D +{ + File = "donut12d.bmp" ; +}; +Bitmap BMP_KEGELQ_3D_1 +{ + File = "kegel1q.bmp" ; +}; +Bitmap BMP_KEGELQ_3D_2 +{ + File = "kegel2q.bmp" ; +}; +Bitmap BMP_KEGELQ_3D_3 +{ + File = "kegel3q.bmp" ; +}; +Bitmap BMP_KEGELQ_3D_4 +{ + File = "kegel4q.bmp" ; +}; +Bitmap BMP_KEGEL_3D_1 +{ + File = "kegel1.bmp" ; +}; +Bitmap BMP_KEGEL_3D_2 +{ + File = "kegel2.bmp" ; +}; +Bitmap BMP_KEGEL_3D_3 +{ + File = "kegel3.bmp" ; +}; +Bitmap BMP_KEGEL_3D_4 +{ + File = "kegel4.bmp" ; +}; +//--------------------- +/* +Bitmap BMP_LINESYMB_2D +{ + File = "lnsym2d.bmp" ; +}; +*/ +Bitmap BMP_LINESYMB_2D_1 +{ + File = "lnsym2d1.bmp" ; +}; +Bitmap BMP_LINESYMB_2D_2 +{ + File = "lnsym2d2.bmp" ; +}; +Bitmap BMP_LINESYMB_2D_3 +{ + File = "lnsym2d3.bmp" ; +}; +//--------------------- +Bitmap BMP_LINES_2D +{ + File = "lines2d.bmp" ; +}; +Bitmap BMP_LINES_2D_1 +{ + File = "lines2d1.bmp" ; +}; +Bitmap BMP_LINES_2D_2 +{ + File = "lines2d2.bmp" ; +}; +Bitmap BMP_LINES_2D_3 +{ + File = "lines2d3.bmp" ; +}; +Bitmap BMP_LINES_3D +{ + File = "lines3d.bmp" ; +}; +//--------------------- +Bitmap BMP_NETSYMB_2D +{ + File = "net2dsym.bmp" ; +}; +Bitmap BMP_NETSYMB_2D_PERCENT +{ + File = "n2dsympr.bmp" ; +}; +Bitmap BMP_NETSYMB_2D_STACK +{ + File = "n2dsymst.bmp" ; +}; +Bitmap BMP_NET_2D +{ + File = "net2d.bmp" ; +}; +Bitmap BMP_NET_2D_PERCENT +{ + File = "net2dpr.bmp" ; +}; +Bitmap BMP_NET_2D_STACK +{ + File = "net2dst.bmp" ; +}; +//--------------------- +Bitmap BMP_PYRAMIDQ_3D_1 +{ + File = "pyra1q.bmp" ; +}; +Bitmap BMP_PYRAMIDQ_3D_2 +{ + File = "pyra2q.bmp" ; +}; +Bitmap BMP_PYRAMIDQ_3D_3 +{ + File = "pyra3q.bmp" ; +}; +Bitmap BMP_PYRAMIDQ_3D_4 +{ + File = "pyra4q.bmp" ; +}; +Bitmap BMP_PYRAMID_3D_1 +{ + File = "pyra1.bmp" ; +}; +Bitmap BMP_PYRAMID_3D_2 +{ + File = "pyra2.bmp" ; +}; +Bitmap BMP_PYRAMID_3D_3 +{ + File = "pyra3.bmp" ; +}; +Bitmap BMP_PYRAMID_3D_4 +{ + File = "pyra4.bmp" ; +}; +//--------------------- +Bitmap BMP_ROEHRE_3D_1 +{ + File = "roehre1.bmp" ; +}; +Bitmap BMP_ROEHRE_3D_2 +{ + File = "roehre2.bmp" ; +}; +Bitmap BMP_ROEHRE_3D_3 +{ + File = "roehre3.bmp" ; +}; +Bitmap BMP_ROEHRE_3D_4 +{ + File = "roehre4.bmp" ; +}; +//--------------------- +Bitmap BMP_SAEULE_3D_1 +{ + File = "saeule1.bmp" ; +}; +Bitmap BMP_SAEULE_3D_2 +{ + File = "saeule2.bmp" ; +}; +Bitmap BMP_SAEULE_3D_3 +{ + File = "saeule3.bmp" ; +}; +Bitmap BMP_SAEULE_3D_4 +{ + File = "saeule4.bmp" ; +}; +//--------------------- +Bitmap BMP_SPLINE_B +{ + File = "splineb.bmp" ; +}; +Bitmap BMP_SPLINE_B_SYMBOL +{ + File = "splnbsym.bmp" ; +}; +Bitmap BMP_SPLINE_CUBIC +{ + File = "spline.bmp" ; +}; +Bitmap BMP_SPLINE_CUBIC_SYMBOL +{ + File = "splnesym.bmp" ; +}; +//--------------------- +Bitmap BMP_STOCK_1 +{ + File = "stock2d1.bmp" ; +}; +Bitmap BMP_STOCK_2 +{ + File = "stock2d2.bmp" ; +}; +Bitmap BMP_STOCK_3 +{ + File = "stock2d3.bmp" ; +}; +Bitmap BMP_STOCK_4 +{ + File = "stock2d4.bmp" ; +}; +//--------------------- +/* +Bitmap BMP_SURF_3D +{ + File = "surf3d.bmp" ; +}; +*/ +Bitmap BMP_XYSYMB_2D +{ + File = "xysym2d.bmp" ; +}; +/* +Bitmap BMP_XYZSYMB_3D +{ + File = "xyzsym3d.bmp" ; +}; +Bitmap BMP_XYZ_3D +{ + File = "xyz3d.bmp" ; +}; +*/ +Bitmap BMP_XY_2D +{ + File = "xy2d.bmp" ; +}; +//--------------------- +//--------------------- +//--------------------- +//error indicator +Bitmap BMP_INDICATE_NONE +{ + File = "indinone.bmp" ; +}; +Bitmap BMP_INDICATE_BOTH +{ + File = "indiboth.bmp" ; +}; +Bitmap BMP_INDICATE_DOWN +{ + File = "indidown.bmp" ; +}; +Bitmap BMP_INDICATE_UP +{ + File = "indiup.bmp" ; +}; +//--------------------- +//regression curves +Bitmap BMP_REGRESSION_NONE +{ + File = "regno.bmp" ; +}; +Bitmap BMP_REGRESSION_LINEAR +{ + File = "reglin.bmp" ; +}; +Bitmap BMP_REGRESSION_LOG +{ + File = "reglog.bmp" ; +}; +Bitmap BMP_REGRESSION_EXP +{ + File = "regexp.bmp" ; +}; +Bitmap BMP_REGRESSION_POWER +{ + File = "regpow.bmp" ; +}; +//--------------------- diff --git a/chart2/source/controller/dialogs/Bitmaps_HC.hrc b/chart2/source/controller/dialogs/Bitmaps_HC.hrc new file mode 100644 index 000000000000..9d26b8f76eee --- /dev/null +++ b/chart2/source/controller/dialogs/Bitmaps_HC.hrc @@ -0,0 +1,174 @@ +/************************************************************************* + * + * $RCSfile: Bitmaps_HC.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _SOLAR_HRC +#include <svtools/solar.hrc> +#endif + +// RID_SCH_START is 30512 (see svtools/solar.hrc) + +// chart types +#define BMP_AREAS_2D_HC ( RID_SCH_START + 0 ) +#define BMP_AREAS_2D_1_HC ( RID_SCH_START + 1 ) +#define BMP_AREAS_2D_3_HC ( RID_SCH_START + 2 ) +#define BMP_AREAS_3D_HC ( RID_SCH_START + 3 ) +#define BMP_AREAS_3D_1_HC ( RID_SCH_START + 4 ) +#define BMP_AREAS_3D_2_HC ( RID_SCH_START + 5 ) + +#define BMP_BARS_2D_HC ( RID_SCH_START + 6 ) +#define BMP_BARS_2D_1_HC ( RID_SCH_START + 7 ) +#define BMP_BARS_2D_2_HC ( RID_SCH_START + 8 ) +#define BMP_BARS_2D_3_HC ( RID_SCH_START + 9 ) +#define BMP_BARS_3D_HC ( RID_SCH_START + 10 ) +#define BMP_BARS_3D_1_HC ( RID_SCH_START + 11 ) +#define BMP_BARS_3D_2_HC ( RID_SCH_START + 12 ) +#define BMP_BARS_3D_3_HC ( RID_SCH_START + 13 ) + +#define BMP_CIRCLES_2D_HC ( RID_SCH_START + 14 ) +#define BMP_CIRCLES_2D_1_HC ( RID_SCH_START + 15 ) +#define BMP_CIRCLES_2D_2_HC ( RID_SCH_START + 16 ) +#define BMP_CIRCLES_3D_HC ( RID_SCH_START + 17 ) + +#define BMP_COLUMNS_2D_HC ( RID_SCH_START + 18 ) +#define BMP_COLUMNS_2D_1_HC ( RID_SCH_START + 19 ) +#define BMP_COLUMNS_2D_2_HC ( RID_SCH_START + 20 ) +#define BMP_COLUMNS_2D_3_HC ( RID_SCH_START + 21 ) +#define BMP_COLUMNS_2D_4_HC ( RID_SCH_START + 22 ) +#define BMP_COLUMNS_2D_5_HC ( RID_SCH_START + 80 ) +#define BMP_COLUMNS_3D_HC ( RID_SCH_START + 23 ) +#define BMP_COLUMNS_3D_1_HC ( RID_SCH_START + 24 ) +#define BMP_COLUMNS_3D_2_HC ( RID_SCH_START + 25 ) +#define BMP_COLUMNS_3D_3_HC ( RID_SCH_START + 26 ) + +#define BMP_DONUT1_2D_HC ( RID_SCH_START + 27 ) + +#define BMP_KEGELQ_3D_1_HC ( RID_SCH_START + 28 ) +#define BMP_KEGELQ_3D_2_HC ( RID_SCH_START + 29 ) +#define BMP_KEGELQ_3D_3_HC ( RID_SCH_START + 30 ) +#define BMP_KEGELQ_3D_4_HC ( RID_SCH_START + 31 ) +#define BMP_KEGEL_3D_1_HC ( RID_SCH_START + 32 ) +#define BMP_KEGEL_3D_2_HC ( RID_SCH_START + 33 ) +#define BMP_KEGEL_3D_3_HC ( RID_SCH_START + 34 ) +#define BMP_KEGEL_3D_4_HC ( RID_SCH_START + 35 ) + +//#define BMP_LINESYMB_2D_HC ( RID_SCH_START + 36 ) +#define BMP_LINESYMB_2D_1_HC ( RID_SCH_START + 37 ) +#define BMP_LINESYMB_2D_2_HC ( RID_SCH_START + 38 ) +#define BMP_LINESYMB_2D_3_HC ( RID_SCH_START + 39 ) + +#define BMP_LINES_2D_HC ( RID_SCH_START + 40 ) +#define BMP_LINES_2D_1_HC ( RID_SCH_START + 41 ) +#define BMP_LINES_2D_2_HC ( RID_SCH_START + 42 ) +#define BMP_LINES_2D_3_HC ( RID_SCH_START + 43 ) +#define BMP_LINES_3D_HC ( RID_SCH_START + 44 ) + +#define BMP_NETSYMB_2D_HC ( RID_SCH_START + 45 ) +#define BMP_NETSYMB_2D_PERCENT_HC ( RID_SCH_START + 46 ) +#define BMP_NETSYMB_2D_STACK_HC ( RID_SCH_START + 47 ) +#define BMP_NET_2D_HC ( RID_SCH_START + 48 ) +#define BMP_NET_2D_PERCENT_HC ( RID_SCH_START + 49 ) +#define BMP_NET_2D_STACK_HC ( RID_SCH_START + 50 ) + +#define BMP_PYRAMIDQ_3D_1_HC ( RID_SCH_START + 51 ) +#define BMP_PYRAMIDQ_3D_2_HC ( RID_SCH_START + 52 ) +#define BMP_PYRAMIDQ_3D_3_HC ( RID_SCH_START + 53 ) +#define BMP_PYRAMIDQ_3D_4_HC ( RID_SCH_START + 54 ) + +#define BMP_PYRAMID_3D_1_HC ( RID_SCH_START + 55 ) +#define BMP_PYRAMID_3D_2_HC ( RID_SCH_START + 56 ) +#define BMP_PYRAMID_3D_3_HC ( RID_SCH_START + 57 ) +#define BMP_PYRAMID_3D_4_HC ( RID_SCH_START + 58 ) + +#define BMP_ROEHRE_3D_1_HC ( RID_SCH_START + 59 ) +#define BMP_ROEHRE_3D_2_HC ( RID_SCH_START + 60 ) +#define BMP_ROEHRE_3D_3_HC ( RID_SCH_START + 61 ) +#define BMP_ROEHRE_3D_4_HC ( RID_SCH_START + 62 ) + +#define BMP_SAEULE_3D_1_HC ( RID_SCH_START + 63 ) +#define BMP_SAEULE_3D_2_HC ( RID_SCH_START + 64 ) +#define BMP_SAEULE_3D_3_HC ( RID_SCH_START + 65 ) +#define BMP_SAEULE_3D_4_HC ( RID_SCH_START + 66 ) + +#define BMP_SPLINE_B_HC ( RID_SCH_START + 67 ) +#define BMP_SPLINE_B_SYMBOL_HC ( RID_SCH_START + 68 ) +#define BMP_SPLINE_CUBIC_HC ( RID_SCH_START + 69 ) +#define BMP_SPLINE_CUBIC_SYMBOL_HC ( RID_SCH_START + 70 ) + +#define BMP_STOCK_1_HC ( RID_SCH_START + 71 ) +#define BMP_STOCK_2_HC ( RID_SCH_START + 72 ) +#define BMP_STOCK_3_HC ( RID_SCH_START + 73 ) +#define BMP_STOCK_4_HC ( RID_SCH_START + 74 ) + +//#define BMP_SURF_3D_HC ( RID_SCH_START + 75 ) +#define BMP_XYSYMB_2D_HC ( RID_SCH_START + 76 ) +//#define BMP_XYZSYMB_3D_HC ( RID_SCH_START + 77 ) +//#define BMP_XYZ_3D_HC ( RID_SCH_START + 78 ) +#define BMP_XY_2D_HC ( RID_SCH_START + 79 ) + +//SchStatisticTabPage and SchDataStatisticsDlg +#define BMP_INDICATE_NONE_HC ( RID_SCH_START + 81 ) +#define BMP_INDICATE_BOTH_HC ( RID_SCH_START + 82 ) +#define BMP_INDICATE_UP_HC ( RID_SCH_START + 83 ) +#define BMP_INDICATE_DOWN_HC ( RID_SCH_START + 84 ) +#define BMP_REGRESSION_NONE_HC ( RID_SCH_START + 85 ) +#define BMP_REGRESSION_LINEAR_HC ( RID_SCH_START + 86 ) +#define BMP_REGRESSION_LOG_HC ( RID_SCH_START + 87 ) +#define BMP_REGRESSION_EXP_HC ( RID_SCH_START + 88 ) +#define BMP_REGRESSION_POWER_HC ( RID_SCH_START + 89 ) diff --git a/chart2/source/controller/dialogs/Bitmaps_HC.src b/chart2/source/controller/dialogs/Bitmaps_HC.src new file mode 100644 index 000000000000..38ba055fef7e --- /dev/null +++ b/chart2/source/controller/dialogs/Bitmaps_HC.src @@ -0,0 +1,449 @@ +/************************************************************************* + * + * $RCSfile: Bitmaps_HC.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Bitmaps_HC.hrc" + +Bitmap BMP_AREAS_2D_HC +{ + File = "areas2d_h.bmp" ; +}; +Bitmap BMP_AREAS_2D_1_HC +{ + File = "areas2d1_h.bmp" ; +}; +Bitmap BMP_AREAS_2D_3_HC +{ + File = "areas2d3_h.bmp" ; +}; +Bitmap BMP_AREAS_3D_HC +{ + File = "areas3d_h.bmp" ; +}; +Bitmap BMP_AREAS_3D_1_HC +{ + File = "areas3d1_h.bmp" ; +}; +Bitmap BMP_AREAS_3D_2_HC +{ + File = "areas3d2_h.bmp" ; +}; +//--------------------- +Bitmap BMP_BARS_2D_HC +{ + File = "bars2d_h.bmp" ; +}; +Bitmap BMP_BARS_2D_1_HC +{ + File = "bars2d1_h.bmp" ; +}; +Bitmap BMP_BARS_2D_2_HC +{ + File = "bars2d2_h.bmp" ; +}; +Bitmap BMP_BARS_2D_3_HC +{ + File = "bars2d3_h.bmp" ; +}; +Bitmap BMP_BARS_3D_HC +{ + File = "bars3d_h.bmp" ; +}; +Bitmap BMP_BARS_3D_1_HC +{ + File = "bars3d1_h.bmp" ; +}; +Bitmap BMP_BARS_3D_2_HC +{ + File = "bars3d2_h.bmp" ; +}; +Bitmap BMP_BARS_3D_3_HC +{ + File = "bars3d3_h.bmp" ; +}; +//--------------------- +Bitmap BMP_CIRCLES_2D_HC +{ + File = "circl2d_h.bmp" ; +}; +Bitmap BMP_CIRCLES_2D_1_HC +{ + File = "circl2d1_h.bmp" ; +}; +Bitmap BMP_CIRCLES_2D_2_HC +{ + File = "circl2d2_h.bmp" ; +}; +Bitmap BMP_CIRCLES_3D_HC +{ + File = "circl3d_h.bmp" ; +}; +//--------------------- +Bitmap BMP_COLUMNS_2D_HC +{ + File = "cols2d_h.bmp" ; +}; +Bitmap BMP_COLUMNS_2D_1_HC +{ + File = "cols2d1_h.bmp" ; +}; +Bitmap BMP_COLUMNS_2D_2_HC +{ + File = "cols2d2_h.bmp" ; +}; +Bitmap BMP_COLUMNS_2D_3_HC +{ + File = "cols2d3_h.bmp" ; +}; +Bitmap BMP_COLUMNS_2D_4_HC +{ + File = "cols2d4_h.bmp" ; +}; +Bitmap BMP_COLUMNS_2D_5_HC +{ + File = "cols2d5_h.bmp" ; +}; +//--------------------- +Bitmap BMP_COLUMNS_3D_HC +{ + File = "cols3d_h.bmp" ; +}; +Bitmap BMP_COLUMNS_3D_1_HC +{ + File = "cols3d1_h.bmp" ; +}; +Bitmap BMP_COLUMNS_3D_2_HC +{ + File = "cols3d2_h.bmp" ; +}; +Bitmap BMP_COLUMNS_3D_3_HC +{ + File = "cols3d3_h.bmp" ; +}; +//--------------------- +Bitmap BMP_DONUT1_2D_HC +{ + File = "donut12d_h.bmp" ; +}; +Bitmap BMP_KEGELQ_3D_1_HC +{ + File = "kegel1q_h.bmp" ; +}; +Bitmap BMP_KEGELQ_3D_2_HC +{ + File = "kegel2q_h.bmp" ; +}; +Bitmap BMP_KEGELQ_3D_3_HC +{ + File = "kegel3q_h.bmp" ; +}; +Bitmap BMP_KEGELQ_3D_4_HC +{ + File = "kegel4q_h.bmp" ; +}; +Bitmap BMP_KEGEL_3D_1_HC +{ + File = "kegel1_h.bmp" ; +}; +Bitmap BMP_KEGEL_3D_2_HC +{ + File = "kegel2_h.bmp" ; +}; +Bitmap BMP_KEGEL_3D_3_HC +{ + File = "kegel3_h.bmp" ; +}; +Bitmap BMP_KEGEL_3D_4_HC +{ + File = "kegel4_h.bmp" ; +}; +//--------------------- +/* +Bitmap BMP_LINESYMB_2D_HC +{ + File = "lnsym2d_h.bmp" ; +}; +*/ +Bitmap BMP_LINESYMB_2D_1_HC +{ + File = "lnsym2d1_h.bmp" ; +}; +Bitmap BMP_LINESYMB_2D_2_HC +{ + File = "lnsym2d2_h.bmp" ; +}; +Bitmap BMP_LINESYMB_2D_3_HC +{ + File = "lnsym2d3_h.bmp" ; +}; +//--------------------- +Bitmap BMP_LINES_2D_HC +{ + File = "lines2d_h.bmp" ; +}; +Bitmap BMP_LINES_2D_1_HC +{ + File = "lines2d1_h.bmp" ; +}; +Bitmap BMP_LINES_2D_2_HC +{ + File = "lines2d2_h.bmp" ; +}; +Bitmap BMP_LINES_2D_3_HC +{ + File = "lines2d3_h.bmp" ; +}; +Bitmap BMP_LINES_3D_HC +{ + File = "lines3d_h.bmp" ; +}; +//--------------------- +Bitmap BMP_NETSYMB_2D_HC +{ + File = "net2dsym_h.bmp" ; +}; +Bitmap BMP_NETSYMB_2D_PERCENT_HC +{ + File = "n2dsympr_h.bmp" ; +}; +Bitmap BMP_NETSYMB_2D_STACK_HC +{ + File = "n2dsymst_h.bmp" ; +}; +Bitmap BMP_NET_2D_HC +{ + File = "net2d_h.bmp" ; +}; +Bitmap BMP_NET_2D_PERCENT_HC +{ + File = "net2dpr_h.bmp" ; +}; +Bitmap BMP_NET_2D_STACK_HC +{ + File = "net2dst_h.bmp" ; +}; +//--------------------- +Bitmap BMP_PYRAMIDQ_3D_1_HC +{ + File = "pyra1q_h.bmp" ; +}; +Bitmap BMP_PYRAMIDQ_3D_2_HC +{ + File = "pyra2q_h.bmp" ; +}; +Bitmap BMP_PYRAMIDQ_3D_3_HC +{ + File = "pyra3q_h.bmp" ; +}; +Bitmap BMP_PYRAMIDQ_3D_4_HC +{ + File = "pyra4q_h.bmp" ; +}; +Bitmap BMP_PYRAMID_3D_1_HC +{ + File = "pyra1_h.bmp" ; +}; +Bitmap BMP_PYRAMID_3D_2_HC +{ + File = "pyra2_h.bmp" ; +}; +Bitmap BMP_PYRAMID_3D_3_HC +{ + File = "pyra3_h.bmp" ; +}; +Bitmap BMP_PYRAMID_3D_4_HC +{ + File = "pyra4_h.bmp" ; +}; +//--------------------- +Bitmap BMP_ROEHRE_3D_1_HC +{ + File = "roehre1_h.bmp" ; +}; +Bitmap BMP_ROEHRE_3D_2_HC +{ + File = "roehre2_h.bmp" ; +}; +Bitmap BMP_ROEHRE_3D_3_HC +{ + File = "roehre3_h.bmp" ; +}; +Bitmap BMP_ROEHRE_3D_4_HC +{ + File = "roehre4_h.bmp" ; +}; +//--------------------- +Bitmap BMP_SAEULE_3D_1_HC +{ + File = "saeule1_h.bmp" ; +}; +Bitmap BMP_SAEULE_3D_2_HC +{ + File = "saeule2_h.bmp" ; +}; +Bitmap BMP_SAEULE_3D_3_HC +{ + File = "saeule3_h.bmp" ; +}; +Bitmap BMP_SAEULE_3D_4_HC +{ + File = "saeule4_h.bmp" ; +}; +//--------------------- +Bitmap BMP_SPLINE_B_HC +{ + File = "splineb_h.bmp" ; +}; +Bitmap BMP_SPLINE_B_SYMBOL_HC +{ + File = "splnbsym_h.bmp" ; +}; +Bitmap BMP_SPLINE_CUBIC_HC +{ + File = "spline_h.bmp" ; +}; +Bitmap BMP_SPLINE_CUBIC_SYMBOL_HC +{ + File = "splnesym_h.bmp" ; +}; +//--------------------- +Bitmap BMP_STOCK_1_HC +{ + File = "stock2d1_h.bmp" ; +}; +Bitmap BMP_STOCK_2_HC +{ + File = "stock2d2_h.bmp" ; +}; +Bitmap BMP_STOCK_3_HC +{ + File = "stock2d3_h.bmp" ; +}; +Bitmap BMP_STOCK_4_HC +{ + File = "stock2d4_h.bmp" ; +}; +//--------------------- +/* +Bitmap BMP_SURF_3D_HC +{ + File = "surf3d_h.bmp" ; +}; +*/ +Bitmap BMP_XYSYMB_2D_HC +{ + File = "xysym2d_h.bmp" ; +}; +/* +Bitmap BMP_XYZSYMB_3D_HC +{ + File = "xyzsym3d_h.bmp" ; +}; +Bitmap BMP_XYZ_3D_HC +{ + File = "xyz3d_h.bmp" ; +}; +*/ +Bitmap BMP_XY_2D_HC +{ + File = "xy2d_h.bmp" ; +}; +//--------------------- +//--------------------- +//--------------------- +//error indicator +Bitmap BMP_INDICATE_NONE_HC +{ + File = "indinone_h.bmp" ; +}; +Bitmap BMP_INDICATE_BOTH_HC +{ + File = "indiboth_h.bmp" ; +}; +Bitmap BMP_INDICATE_UP_HC +{ + File = "indiup_h.bmp" ; +}; +Bitmap BMP_INDICATE_DOWN_HC +{ + File = "indidown_h.bmp" ; +}; +//--------------------- +//regression curves +Bitmap BMP_REGRESSION_NONE_HC +{ + File = "regno_h.bmp" ; +}; +Bitmap BMP_REGRESSION_LINEAR_HC +{ + File = "reglin_h.bmp" ; +}; +Bitmap BMP_REGRESSION_LOG_HC +{ + File = "reglog_h.bmp" ; +}; +Bitmap BMP_REGRESSION_EXP_HC +{ + File = "regexp_h.bmp" ; +}; +Bitmap BMP_REGRESSION_POWER_HC +{ + File = "regpow_h.bmp" ; +}; +//--------------------- diff --git a/chart2/source/controller/dialogs/CommonResources.hrc b/chart2/source/controller/dialogs/CommonResources.hrc new file mode 100644 index 000000000000..10c0e44ce791 --- /dev/null +++ b/chart2/source/controller/dialogs/CommonResources.hrc @@ -0,0 +1,85 @@ +/************************************************************************* + * + * $RCSfile: CommonResources.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_RESOURCE_HXX +#define _CHART2_RESOURCE_HXX + +#define BUTTONS_OK_CANCEL_HELP_STACKED( xpos ) \ +OKButton BTN_OK \ +{ \ + Pos = MAP_APPFONT ( xpos , 6 ) ; \ + Size = MAP_APPFONT ( 50 , 14 ) ; \ + TabStop = TRUE ; \ + DefButton = TRUE ; \ +}; \ +CancelButton BTN_CANCEL \ +{ \ + Pos = MAP_APPFONT ( xpos , 23 ) ; \ + Size = MAP_APPFONT ( 50 , 14 ) ; \ + TabStop = TRUE ; \ +}; \ +HelpButton BTN_HELP \ +{ \ + Pos = MAP_APPFONT ( xpos , 43 ) ; \ + Size = MAP_APPFONT ( 50 , 14 ) ; \ + TabStop = TRUE ; \ +}; + +#endif diff --git a/chart2/source/controller/dialogs/Strings.src b/chart2/source/controller/dialogs/Strings.src new file mode 100644 index 000000000000..1f2ad17b271e --- /dev/null +++ b/chart2/source/controller/dialogs/Strings.src @@ -0,0 +1,3188 @@ +/************************************************************************* + * + * $RCSfile: Strings.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Strings.hrc" + +String STR_TITLE_GRID +{ + Text = "Gitter" ; + Text [ ENGLISH ] = "Grid" ; + Text [ norwegian ] = "Grid" ; + Text [ italian ] = "Griglia" ; + Text [ portuguese_brazilian ] = "Grade" ; + Text [ portuguese ] = "Grelha" ; + Text [ finnish ] = "Ruudukko" ; + Text [ danish ] = "Gitter" ; + Text [ french ] = "Grille" ; + Text [ swedish ] = "Gitter" ; + Text [ dutch ] = "Raster" ; + Text [ spanish ] = "Cuadrcula" ; + Text [ english_us ] = "Grid" ; + Text[ chinese_simplified ] = "网格线"; + Text[ russian ] = ""; + Text[ polish ] = "Siatka"; + Text[ japanese ] = "目盛線"; + Text[ chinese_traditional ] = "網格"; + Text[ arabic ] = ""; + Text[ dutch ] = "Raster"; + Text[ chinese_simplified ] = "网格线"; + Text[ greek ] = ""; + Text[ korean ] = "눈금선"; + Text[ turkish ] = "Klavuz izgiler"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Graella"; + Text[ thai ] = "เส้นตาราง"; + Text[ czech ] = "Mřížka"; + Text[ hebrew ] = "Gitter"; + Text[ hindi ] = "जाल"; + Text[ slovak ] = "Mriežka"; +}; + +/* +String RID_BUILDVERSION +{ + Text = UPDVER ; + Text [ ENGLISH ] = UPDVER ; + Text [ norwegian ] = UPDVER ; + Text [ italian ] = UPDVER ; + Text [ portuguese_brazilian ] = UPDVER ; + Text [ portuguese ] = UPDVER ; + Text [ finnish ] = UPDVER ; + Text [ danish ] = UPDVER ; + Text [ french ] = UPDVER ; + Text [ swedish ] = UPDVER ; + Text [ dutch ] = UPDVER ; + Text [ spanish ] = UPDVER ; + Text [ english_us ] = UPDVER ; +}; +String STR_NULL +{ + Text = "Kein" ; + Text [ ENGLISH ] = "None" ; + Text [ norwegian ] = "Ingen" ; + Text [ italian ] = "Senza" ; + Text [ portuguese_brazilian ] = "Nenhum" ; + Text [ portuguese ] = "Nenhum" ; + Text [ finnish ] = "Ei mitn" ; + Text [ danish ] = "Ingen" ; + Text [ french ] = "Aucun(e)" ; + Text [ swedish ] = "Ingen" ; + Text [ dutch ] = "Geen" ; + Text [ spanish ] = "Ninguno" ; + Text [ english_us ] = "None" ; + Text[ chinese_simplified ] = "无"; + Text[ russian ] = ""; + Text[ polish ] = "Brak"; + Text[ japanese ] = "なし"; + Text[ chinese_traditional ] = "無"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "없음"; + Text[ turkish ] = "Yok"; + Text[ catalan ] = "Cap"; + Text[ thai ] = "ไม่มี"; + Text[ czech ] = "Žádné"; + Text[ hebrew ] = "ללא"; + Text[ hindi ] = "कोई नहीं"; + Text[ slovak ] = "Žiadne"; +}; +String STR_BASIC_IDE +{ + Text = "Basic-IDE" ; + Text [ ENGLISH ] = "Basic-IDE" ; + Text [ norwegian ] = "Basic-IDE" ; + Text [ italian ] = "%PRODUCTNAME Basic-IDE" ; + Text [ portuguese_brazilian ] = "IDE Bsico" ; + Text [ portuguese ] = "Basic-IDE" ; + Text [ finnish ] = "Basic IDE" ; + Text [ danish ] = "Basic-IDE" ; + Text [ french ] = "Basic-IDE" ; + Text [ swedish ] = "Basic-IDE" ; + Text [ dutch ] = "Basic-IDE" ; + Text [ spanish ] = "Basic-IDE" ; + Text [ english_us ] = "Basic IDE" ; + Text[ chinese_simplified ] = "Basic-IDE"; + Text[ russian ] = " Basic"; + Text[ polish ] = "rodowisko programowania w jzyku Basic"; + Text[ japanese ] = "Basic IDE"; + Text[ chinese_traditional ] = "Basic-IDE"; + Text[ arabic ] = "Basic IDE"; + Text[ greek ] = "Basic IDE"; + Text[ korean ] = "Basic IDE"; + Text[ turkish ] = "Basic-IDE"; + Text[ catalan ] = "Basic-IDE"; + Text[ thai ] = "เบสิค IDE"; + Text[ czech ] = "Základní IDE"; + Text[ hebrew ] = "Basic-IDE"; + Text[ hindi ] = "मूल IDE"; + Text[ slovak ] = "Základný IDE"; +}; +String STR_INVISIBLE +{ + Text = "Unsichtbar" ; + Text [ ENGLISH ] = "Invisible" ; + Text [ norwegian ] = "Usynlig" ; + Text [ italian ] = "Invisibile" ; + Text [ portuguese_brazilian ] = "Invisvel" ; + Text [ portuguese ] = "Invisvel" ; + Text [ finnish ] = "Nkymtn" ; + Text [ danish ] = "Usynlig" ; + Text [ french ] = "Invisible" ; + Text [ swedish ] = "Osynlig" ; + Text [ dutch ] = "Onzichtbaar" ; + Text [ spanish ] = "Invisible" ; + Text [ english_us ] = "Invisible" ; + Text[ chinese_simplified ] = "隐入的"; + Text[ russian ] = ""; + Text[ polish ] = "Niewidoczny"; + Text[ japanese ] = "非表示"; + Text[ chinese_traditional ] = "隱入的"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "숨김"; + Text[ turkish ] = "Gizle"; + Text[ catalan ] = "Invisible"; + Text[ thai ] = "มองไม่เห็น"; + Text[ czech ] = "Neviditelný"; + Text[ hebrew ] = "Unsichtbar"; + Text[ hindi ] = "अदृष्टिगोचर"; + Text[ slovak ] = "Neviditeľná"; +}; +String STR_SOLID +{ + Text = "Durchgngig" ; + Text [ ENGLISH ] = "Solid" ; + Text [ norwegian ] = "Solid" ; + Text [ italian ] = "Piena" ; + Text [ portuguese_brazilian ] = "Contnuo" ; + Text [ portuguese ] = "Contnuo" ; + Text [ finnish ] = "Jatkuva" ; + Text [ danish ] = "Gennemgende" ; + Text [ french ] = "Continu" ; + Text [ swedish ] = "Genomgende" ; + Text [ dutch ] = "Gesloten" ; + Text [ spanish ] = "Continuo" ; + Text [ english_us ] = "Continuous" ; + Text[ chinese_simplified ] = "持续的"; + Text[ russian ] = ""; + Text[ polish ] = "Cigy"; + Text[ japanese ] = "実線"; + Text[ chinese_traditional ] = "持續的"; + Text[ arabic ] = ""; + Text[ language_user1 ] = "nk 07.08.99 : Hat es mit Linienstil zu tun? Bitte mich informieren! Danke - - - -"; + Text[ greek ] = ""; + Text[ korean ] = "계속"; + Text[ turkish ] = "Srekli"; + Text[ catalan ] = "Continu"; + Text[ thai ] = "ต่อเนื่อง"; + Text[ czech ] = "Spojitý"; + Text[ hebrew ] = "רציף"; + Text[ hindi ] = "निरन्तर"; + Text[ slovak ] = "Spojitý"; +}; +String STR_AREA +{ + Text = "Flche" ; + Text [ ENGLISH ] = "Object fill" ; + Text [ norwegian ] = "Objekt fyll" ; + Text [ italian ] = "Area" ; + Text [ portuguese_brazilian ] = "rea" ; + Text [ portuguese ] = "Preenchimento" ; + Text [ finnish ] = "Alue" ; + Text [ danish ] = "Omrde" ; + Text [ french ] = "Remplissage" ; + Text [ swedish ] = "Yta" ; + Text [ dutch ] = "Vlak" ; + Text [ spanish ] = "rea" ; + Text [ english_us ] = "Area" ; + Text[ chinese_simplified ] = "充填平面"; + Text[ russian ] = ""; + Text[ polish ] = "Obszar"; + Text[ japanese ] = "エリア"; + Text[ chinese_traditional ] = "充填平面"; + Text[ arabic ] = " "; + Text[ greek ] = ""; + Text[ korean ] = "영역"; + Text[ turkish ] = "Yzey"; + Text[ catalan ] = "rea"; + Text[ thai ] = "พื้นที่"; + Text[ czech ] = "Oblast"; + Text[ hebrew ] = "Fläche"; + Text[ hindi ] = "विस्तीर्ण"; + Text[ slovak ] = "Oblasť"; +}; +String STR_LINE +{ + Text = "Linie" ; + Text [ ENGLISH ] = "Line" ; + Text [ norwegian ] = "Linje" ; + Text [ italian ] = "Linea" ; + Text [ portuguese_brazilian ] = "Linha" ; + Text [ portuguese ] = "Linha" ; + Text [ finnish ] = "Viiva" ; + Text [ danish ] = "Linje" ; + Text [ french ] = "Ligne" ; + Text [ swedish ] = "Linje" ; + Text [ dutch ] = "Lijn" ; + Text [ spanish ] = "Lnea" ; + Text [ english_us ] = "Line" ; + Text[ chinese_simplified ] = "线条"; + Text[ russian ] = ""; + Text[ polish ] = "Linia"; + Text[ japanese ] = "折れ線"; + Text[ chinese_traditional ] = "線條"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "선"; + Text[ turkish ] = "izgi"; + Text[ catalan ] = "Lnia"; + Text[ thai ] = "บรรทัด"; + Text[ czech ] = "Řádek"; + Text[ hebrew ] = "Linie"; + Text[ hindi ] = "Line"; + Text[ slovak ] = "Čiara"; +}; + + + +String STR_NORMAL_LINES +{ + Text = "Normal mit Linien" ; + Text [ ENGLISH ] = "Normal with lines" ; + Text [ dutch ] = "Normaal met lijnen" ; + Text [ english_us ] = "Normal with lines" ; + Text [ italian ] = "Normale con liee" ; + Text [ spanish ] = "Normal con lneas" ; + Text [ french ] = "Normal avec lignes" ; + Text [ swedish ] = "Normal med linjer" ; + Text [ danish ] = "Normal med linjer" ; + Text [ portuguese ] = "Padro com linhas" ; + Text [ portuguese_brazilian ] = "Padro com linhas" ; + Text[ chinese_simplified ] = "普通线条"; + Text[ russian ] = " "; + Text[ polish ] = "Zwyky z liniami"; + Text[ japanese ] = "線付き標準"; + Text[ chinese_traditional ] = "普通線條"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "선 포함 표준"; + Text[ turkish ] = "izgili normal"; + Text[ catalan ] = "Normal amb lnies"; + Text[ finnish ] = "Tavallinen ja viivat"; + Text[ thai ] = "บรรทัดปกติ"; + Text[ czech ] = "Běžná s čárami"; + Text[ hebrew ] = "Normal mit Linien"; + Text[ hindi ] = "रेखों केलिए नॉर्मल्"; + Text[ slovak ] = "Normálny graf s čiarami"; +}; + + + + + +String STR_2D +{ + Text = "2D-" ; + Text [ ENGLISH ] = "2D-" ; + Text [ english_us ] = "2D " ; + Text [ italian ] = "2D-" ; + Text [ spanish ] = "2D-" ; + Text [ french ] = "2D-" ; + Text [ dutch ] = "2D-" ; + Text [ swedish ] = "2D-" ; + Text [ danish ] = "2D-" ; + Text [ portuguese ] = "2D-" ; + Text [ portuguese_brazilian ] = "2D-" ; + Text[ chinese_simplified ] = "2 维"; + Text[ russian ] = ""; + Text[ polish ] = "2D"; + Text[ japanese ] = "2D"; + Text[ chinese_traditional ] = "平面"; + Text[ arabic ] = " "; + Text[ greek ] = "2-"; + Text[ korean ] = "2D"; + Text[ turkish ] = "2B-"; + Text[ catalan ] = "2D "; + Text[ finnish ] = "Kaksiulotteinen "; + Text[ thai ] = "2มิติ "; + Text[ czech ] = "2D"; + Text[ hebrew ] = "2D-"; + Text[ hindi ] = "2D "; + Text[ slovak ] = "2D"; +}; +String STR_3D +{ + Text = "3D-" ; + Text [ ENGLISH ] = "3D-" ; + Text [ english_us ] = "3D " ; + Text [ italian ] = "3D-" ; + Text [ spanish ] = "3D-" ; + Text [ french ] = "3D-" ; + Text [ dutch ] = "3D-" ; + Text [ swedish ] = "3D-" ; + Text [ danish ] = "3D-" ; + Text [ portuguese ] = "3D-" ; + Text [ portuguese_brazilian ] = "3D-" ; + Text[ chinese_simplified ] = "3 维"; + Text[ russian ] = ""; + Text[ polish ] = "3D"; + Text[ japanese ] = "3D"; + Text[ chinese_traditional ] = "3D"; + Text[ arabic ] = " "; + Text[ greek ] = "3-"; + Text[ korean ] = "3D"; + Text[ turkish ] = "3B-"; + Text[ catalan ] = "3D "; + Text[ finnish ] = "Kolmiulotteisuus "; + Text[ thai ] = "3มิติ "; + Text[ czech ] = "3D"; + Text[ hebrew ] = "3D-"; + Text[ hindi ] = "3D "; + Text[ slovak ] = "3D"; +}; +String STR_DIAGRAM_AREA +{ + Text = "Diagrammflche" ; + Text [ ENGLISH ] = "Diagram Area" ; + Text [ english_us ] = "Chart Area" ; + Text [ italian ] = "Area del diagramma" ; + Text [ spanish ] = "Superficie del diagrama" ; + Text [ french ] = "Arrire-plan du diagramme" ; + Text [ dutch ] = "Diagramoppervlak" ; + Text [ swedish ] = "Diagramomrde" ; + Text [ danish ] = "Diagramomrde" ; + Text [ portuguese ] = "rea do grfico" ; + Text [ portuguese_brazilian ] = "rea do Grfico" ; + Text[ chinese_simplified ] = "图表区"; + Text[ russian ] = " "; + Text[ polish ] = "Obszar wykresu"; + Text[ japanese ] = "グラフエリア"; + Text[ chinese_traditional ] = "圖表平面"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "차트 영역"; + Text[ turkish ] = "ema yzeyi"; + Text[ catalan ] = "rea del diagrama"; + Text[ finnish ] = "Kaavioalue"; + Text[ thai ] = "พื้นที่แผนภูมิ"; + Text[ czech ] = "Plocha grafu"; + Text[ hebrew ] = "Diagrammfläche"; + Text[ hindi ] = "Chart Area"; + Text[ slovak ] = "Plocha grafu"; +}; +String STR_DIAGRAM +{ + Text = "Diagramm" ; + Text [ ENGLISH ] = "Diagram" ; + Text [ dutch ] = "Diagram" ; + Text [ english_us ] = "Chart" ; + Text [ italian ] = "Diagramma" ; + Text [ spanish ] = "Diagrama" ; + Text [ french ] = "Diagramme" ; + Text [ swedish ] = "Diagram" ; + Text [ danish ] = "Diagram" ; + Text [ portuguese ] = "Grfico" ; + Text [ portuguese_brazilian ] = "Grfico" ; + Text[ chinese_simplified ] = "图表"; + Text[ russian ] = ""; + Text[ polish ] = "Wykres"; + Text[ japanese ] = "グラフ"; + Text[ chinese_traditional ] = "圖表"; + Text[ arabic ] = " "; + Text[ greek ] = ""; + Text[ korean ] = "차트"; + Text[ turkish ] = "ema"; + Text[ catalan ] = "Diagrama"; + Text[ finnish ] = "Kaavio"; + Text[ thai ] = "แผนภูมิ"; + Text[ czech ] = "Graf"; + Text[ hebrew ] = "תרשים"; + Text[ hindi ] = "चार्ट "; + Text[ slovak ] = "Graf"; +}; +String STR_DIAGRAM_WALL +{ + Text = "Diagrammwand" ; + Text [ ENGLISH ] = "Diagram Wall" ; + Text [ english_us ] = "Chart Wall" ; + Text [ italian ] = "Pareti del diagramma" ; + Text [ spanish ] = "Plano lateral" ; + Text [ french ] = "Paroi du diagramme" ; + Text [ dutch ] = "Diagramwand" ; + Text [ swedish ] = "Diagramvgg" ; + Text [ danish ] = "Diagramvg" ; + Text [ portuguese ] = "Parede do grfico" ; + Text [ portuguese_brazilian ] = "Parede do Grfico" ; + Text[ chinese_simplified ] = "图表背景墙"; + Text[ russian ] = " "; + Text[ polish ] = "ciana wykresu"; + Text[ japanese ] = "グラフの壁面"; + Text[ chinese_traditional ] = "圖表背景牆"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "차트 옆면"; + Text[ turkish ] = "ema duvar"; + Text[ catalan ] = "Pla lateral del diagrama"; + Text[ finnish ] = "Kaaviosein"; + Text[ thai ] = "ผนังแผนภูมิ"; + Text[ czech ] = "Stěna grafu"; + Text[ hebrew ] = "Diagrammwand"; + Text[ hindi ] = "चार्ट वॉल"; + Text[ slovak ] = "Bok grafu"; +}; +String STR_DIAGRAM_FLOOR +{ + Text = "Diagrammboden" ; + Text [ ENGLISH ] = "Diagram Floor" ; + Text [ dutch ] = "Diagrambodem" ; + Text [ english_us ] = "Chart Floor" ; + Text [ italian ] = "Pavimento del diagramma" ; + Text [ spanish ] = "Base del diagrama" ; + Text [ french ] = "Plancher du diagramme" ; + Text [ swedish ] = "Diagramgolv" ; + Text [ danish ] = "Diagramgulv" ; + Text [ portuguese ] = "Base do grfico" ; + Text [ portuguese_brazilian ] = "Piso do Grfico" ; + Text[ chinese_simplified ] = "图表基底"; + Text[ russian ] = " "; + Text[ polish ] = "Podstawa wykresu"; + Text[ japanese ] = "グラフの床面"; + Text[ chinese_traditional ] = "座標軸"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "차트 밑면"; + Text[ turkish ] = "ema taban"; + Text[ catalan ] = "Base del diagrama"; + Text[ finnish ] = "Kaavion perusta"; + Text[ thai ] = "พื้นแผนภูมิ"; + Text[ czech ] = "Pata grafu"; + Text[ hebrew ] = "Diagrammboden"; + Text[ hindi ] = "चार्ट फ्लोर"; + Text[ slovak ] = "Päta grafu"; +}; +String STR_DIAGRAM_X_AXIS +{ + Text = "X-Achse" ; + Text [ ENGLISH ] = "X-Axis" ; + Text [ english_us ] = "X axis" ; + Text [ italian ] = "Asse X" ; + Text [ spanish ] = "Eje X" ; + Text [ french ] = "Axe X" ; + Text [ dutch ] = "X-as" ; + Text [ swedish ] = "X-axel" ; + Text [ danish ] = "X-akse" ; + Text [ portuguese ] = "Eixo X" ; + Text [ portuguese_brazilian ] = "Eixo X" ; + Text[ chinese_simplified ] = "X 轴"; + Text[ russian ] = " X"; + Text[ polish ] = "O X"; + Text[ japanese ] = "X軸"; + Text[ chinese_traditional ] = "X-軸"; + Text[ arabic ] = " "; + Text[ greek ] = " X"; + Text[ korean ] = "X 축"; + Text[ turkish ] = "X ekseni"; + Text[ catalan ] = "Eix X"; + Text[ finnish ] = "X-akseli"; + Text[ thai ] = "แกนX "; + Text[ czech ] = "Osa X"; + Text[ hebrew ] = "X-Achse"; + Text[ hindi ] = "X अक्ष"; + Text[ slovak ] = "Os X"; +}; +String STR_DIAGRAM_Y_AXIS +{ + Text = "Y-Achse" ; + Text [ ENGLISH ] = "Y-Axis" ; + Text [ english_us ] = "Y axis" ; + Text [ italian ] = "Asse Y" ; + Text [ spanish ] = "Eje Y" ; + Text [ french ] = "Axe Y" ; + Text [ dutch ] = "Y-as" ; + Text [ swedish ] = "Y-axel" ; + Text [ danish ] = "Y-akse" ; + Text [ portuguese ] = "Eixo Y" ; + Text [ portuguese_brazilian ] = "Eixo Y" ; + Text[ chinese_simplified ] = "Y 轴"; + Text[ russian ] = " Y"; + Text[ polish ] = "O Y"; + Text[ japanese ] = "Y軸"; + Text[ chinese_traditional ] = "Y-軸"; + Text[ arabic ] = " "; + Text[ greek ] = " Y"; + Text[ korean ] = "Y 축"; + Text[ turkish ] = "Y ekseni"; + Text[ catalan ] = "Eix Y"; + Text[ finnish ] = "Y-akseli"; + Text[ thai ] = "แกนY "; + Text[ czech ] = "Osa Y"; + Text[ hebrew ] = "Y-Achse"; + Text[ hindi ] = "Y अक्ष"; + Text[ slovak ] = "Os Y"; +}; +String STR_DIAGRAM_Z_AXIS +{ + Text = "Z-Achse" ; + Text [ ENGLISH ] = "Z-Axis" ; + Text [ english_us ] = "Z axis" ; + Text [ italian ] = "Asse Z" ; + Text [ spanish ] = "Eje Z" ; + Text [ french ] = "Axe Z" ; + Text [ dutch ] = "Z-as" ; + Text [ swedish ] = "Z-axel" ; + Text [ danish ] = "Z-akse" ; + Text [ portuguese ] = "Eixo Z" ; + Text [ portuguese_brazilian ] = "Eixo Z" ; + Text[ chinese_simplified ] = "Z 轴数值"; + Text[ russian ] = " Z"; + Text[ polish ] = "O Z"; + Text[ japanese ] = "Z軸"; + Text[ chinese_traditional ] = "Z-軸"; + Text[ arabic ] = " "; + Text[ greek ] = " Z"; + Text[ korean ] = "Z 축"; + Text[ turkish ] = "Z ekseni"; + Text[ catalan ] = "Eix Z"; + Text[ finnish ] = "Z-akseli"; + Text[ thai ] = "แกนZ "; + Text[ czech ] = "Osa Z"; + Text[ hebrew ] = "Z-Achse"; + Text[ hindi ] = "Z अक्ष"; + Text[ slovak ] = "Os Z"; +}; +String STR_DIAGRAM_X_GRID_MAIN +{ + Text = "X-Hauptgitter" ; + Text [ ENGLISH ] = "Main X-Grid" ; + Text [ dutch ] = "X-hoofdraster" ; + Text [ english_us ] = "X axis main grid" ; + Text [ italian ] = "Griglia principale X" ; + Text [ spanish ] = "Cuadrcula principal X" ; + Text [ french ] = "Grille principale X" ; + Text [ swedish ] = "X-huvudgitter" ; + Text [ danish ] = "Overordnet X-aksegitter" ; + Text [ portuguese ] = "Grelha X principal" ; + Text [ portuguese_brazilian ] = "Grade principal do eixo X" ; + Text[ chinese_simplified ] = "X 轴网格"; + Text[ russian ] = " X"; + Text[ polish ] = "Gwna siatka osi X"; + Text[ japanese ] = "X軸主目盛線"; + Text[ chinese_traditional ] = "X-軸網格"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "X 축 주 눈금선"; + Text[ turkish ] = "X ana klavuz izgileri"; + Text[ catalan ] = "Graella principal de l'eix X"; + Text[ finnish ] = "X-akselin pruudukko"; + Text[ thai ] = "เส้นตารางหลักX "; + Text[ czech ] = "Hlavní mřížka osy X"; + Text[ hebrew ] = "X-Hauptgitter"; + Text[ hindi ] = "X अक्ष का प्रधान जाल"; + Text[ slovak ] = "Hlavná mriežka osi X"; +}; +String STR_DIAGRAM_Y_GRID_MAIN +{ + Text = "Y-Hauptgitter" ; + Text [ ENGLISH ] = "Main Y-Grid" ; + Text [ english_us ] = "Y main grid" ; + Text [ italian ] = "Griglia principale Y" ; + Text [ spanish ] = "Cuadrcula principal Y" ; + Text [ french ] = "Grille principale Y" ; + Text [ dutch ] = "Y-hoofdraster" ; + Text [ swedish ] = "Y-huvudgitter" ; + Text [ danish ] = "Overordnet Y-aksegitter" ; + Text [ portuguese ] = "Grelha Y principal" ; + Text [ portuguese_brazilian ] = "Grade principal do eixo Y" ; + Text[ chinese_simplified ] = "Y 轴主网格线"; + Text[ russian ] = " Y"; + Text[ polish ] = "Gwna siatka osi Y"; + Text[ japanese ] = "Y軸主目盛線"; + Text[ chinese_traditional ] = "Y-軸主網格線"; + Text[ arabic ] = " "; + Text[ greek ] = " Y"; + Text[ korean ] = "Y 주 눈금선"; + Text[ turkish ] = "Y ana klavuz izgileri"; + Text[ catalan ] = "Graella principal Y"; + Text[ finnish ] = "Y-pruudukko"; + Text[ thai ] = "เส้นตารางหลักY "; + Text[ czech ] = "Hlavní mřížka osy Y"; + Text[ hebrew ] = "Y-Hauptgitter"; + Text[ hindi ] = "Y प्रधान जाल"; + Text[ slovak ] = "Hlavná mriežka osi Y"; +}; +String STR_DIAGRAM_Z_GRID_MAIN +{ + Text = "Z-Hauptgitter" ; + Text [ ENGLISH ] = "Main Z-Grid" ; + Text [ english_us ] = "Z main grid" ; + Text [ italian ] = "Griglia principale Z" ; + Text [ spanish ] = "Cuadrcula principal Z" ; + Text [ french ] = "Grille principale Z" ; + Text [ dutch ] = "Z-hoofdraster" ; + Text [ swedish ] = "Z-huvudgitter" ; + Text [ danish ] = "Overordnet Z-aksegitter" ; + Text [ portuguese ] = "Grelha Z principal" ; + Text [ portuguese_brazilian ] = "Grade principal do eixo Z" ; + Text[ chinese_simplified ] = "Z 轴主网格线"; + Text[ russian ] = " Z"; + Text[ polish ] = "Gwna siatka osi Z"; + Text[ japanese ] = "Z軸主目盛線"; + Text[ chinese_traditional ] = "Z-軸主網格"; + Text[ arabic ] = " "; + Text[ greek ] = " Z"; + Text[ korean ] = "Z 주 눈금선"; + Text[ turkish ] = "Z ana klavuz izgileri"; + Text[ catalan ] = "Graella principal Z"; + Text[ finnish ] = "Z-pruudukko"; + Text[ thai ] = "เส้นตารางหลักZ "; + Text[ czech ] = "Hlavní mřížka osy Z"; + Text[ hebrew ] = "Z-Hauptgitter"; + Text[ hindi ] = "Z प्रधान जाल"; + Text[ slovak ] = "Hlavná mriežka osi Z"; +}; +String STR_DIAGRAM_X_GRID_HELP +{ + Text = "X-Hilfsgitter" ; + Text [ ENGLISH ] = "Help X-Grid" ; + Text [ dutch ] = "X-hulpraster" ; + Text [ english_us ] = "Minor X Grid" ; + Text [ italian ] = "Griglia ausiliaria X" ; + Text [ spanish ] = "Cuadrcula auxiliar X" ; + Text [ french ] = "Grille auxiliaire X" ; + Text [ swedish ] = "X-stdgitter" ; + Text [ danish ] = "Underordnet X-aksegitter" ; + Text [ portuguese ] = "Grelha X auxiliar" ; + Text [ portuguese_brazilian ] = "Grade X segundria" ; + Text[ chinese_simplified ] = "X 轴次网格线"; + Text[ russian ] = " X"; + Text[ polish ] = "Pomocnicza siatka osi X"; + Text[ japanese ] = "X軸補助目盛線"; + Text[ chinese_traditional ] = "X-次網格"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "X 보조 눈금선"; + Text[ turkish ] = "X yardmc klavuz izgileri"; + Text[ catalan ] = "Cuadrcula auxiliar X"; + Text[ finnish ] = "X-apuruudukko"; + Text[ thai ] = "เส้นตารางรอง X "; + Text[ czech ] = "Vedlejší mřížka osy X"; + Text[ hebrew ] = "X-Hilfsgitter"; + Text[ hindi ] = "छोटा X जाल"; + Text[ slovak ] = "Vedľajšia mriežka osi X"; +}; +String STR_DIAGRAM_Y_GRID_HELP +{ + Text = "Y-Hilfsgitter" ; + Text [ ENGLISH ] = "Help Y-Grid" ; + Text [ english_us ] = "Y minor grid" ; + Text [ italian ] = "Griglia ausiliaria Y" ; + Text [ spanish ] = "Cuadrcula auxiliar Y" ; + Text [ french ] = "Grille auxiliaire Y" ; + Text [ dutch ] = "Y-hulpraster" ; + Text [ swedish ] = "Y-stdgitter" ; + Text [ danish ] = "Underordnet Y-aksegitter" ; + Text [ portuguese ] = "Grelha Y auxiliar" ; + Text [ portuguese_brazilian ] = "Grade Y segundria" ; + Text[ chinese_simplified ] = "Y 轴次网格线"; + Text[ russian ] = " Y"; + Text[ polish ] = "Pomocnicza siatka osi Y"; + Text[ japanese ] = "Y軸補助目盛線"; + Text[ chinese_traditional ] = "Y-次網格"; + Text[ arabic ] = " "; + Text[ greek ] = " Y"; + Text[ korean ] = "Y 보조 눈금선"; + Text[ turkish ] = "Y yardmc klavuz izgileri"; + Text[ catalan ] = "Cuadrcula auxiliar Y"; + Text[ finnish ] = "Y-apuruudukko"; + Text[ thai ] = "เส้นตารางรองY "; + Text[ czech ] = "Vedlejší mřížka osy Y"; + Text[ hebrew ] = "Y-Hilfsgitter"; + Text[ hindi ] = "Y छोटा जाल"; + Text[ slovak ] = "Vedľajšia mriežka osi Y"; +}; +String STR_DIAGRAM_Z_GRID_HELP +{ + Text = "Z-Hilfsgitter" ; + Text [ ENGLISH ] = "Help Z-Grid" ; + Text [ english_us ] = "Z minor grid" ; + Text [ italian ] = "Griglia ausiliaria Z" ; + Text [ spanish ] = "Cuadrcula auxiliar Z" ; + Text [ french ] = "Grille auxiliaire Z" ; + Text [ dutch ] = "Z-hulpraster" ; + Text [ swedish ] = "Z-stdgitter" ; + Text [ danish ] = "Underordnet Z-aksegitter" ; + Text [ portuguese ] = "Grelha Z auxiliar" ; + Text [ portuguese_brazilian ] = "Grade Z segundria" ; + Text[ chinese_simplified ] = "Z 轴次网格线"; + Text[ russian ] = " Z"; + Text[ polish ] = "Pomocnicza siatka osi Z"; + Text[ japanese ] = "Z軸補助目盛線"; + Text[ chinese_traditional ] = "Z-次網格"; + Text[ arabic ] = " "; + Text[ greek ] = " Z"; + Text[ korean ] = "Z 보조 눈금선"; + Text[ turkish ] = "Z yardmc klavuz izgileri"; + Text[ catalan ] = "Cuadrcula auxiliar Z"; + Text[ finnish ] = "Z-apuruudukko"; + Text[ thai ] = "เส้นตารางรองZ "; + Text[ czech ] = "Vedlejší mřížka osy Z"; + Text[ hebrew ] = "Z-Hilfsgitter"; + Text[ hindi ] = "Z छोटा जाल"; + Text[ slovak ] = "Vedľajšia mriežka osi Z"; +}; +String STR_DIAGRAM_ROW +{ + // $(ROW) can be a number or the caption of the row in quotes + + Text = "Datenreihe $(ROW)" ; + Text [ english_us ] = "Data Series $(ROW)" ; + Text[ portuguese ] = "Srie de dados $(ROW)"; + Text[ russian ] = " $(ROW)"; + Text[ greek ] = " $(ROW)"; + Text[ dutch ] = "Gegevensreeks $(ROW)"; + Text[ french ] = "Srie de donnes $(ROW)"; + Text[ spanish ] = "Serie de datos $(ROW)"; + Text[ italian ] = "Serie di dati $(ROW)"; + Text[ danish ] = "Dataserie $(ROW)"; + Text[ swedish ] = "Dataserie $(ROW)"; + Text[ polish ] = "Seria danych $(ROW)"; + Text[ portuguese_brazilian ] = "Srie de Dados $(ROW)"; + Text[ japanese ] = "系列$(ROW)"; + Text[ korean ] = "연속 데이터 $(ROW)"; + Text[ chinese_simplified ] = "数据组 $(ROW)"; + Text[ chinese_traditional ] = "資料欄 $(ROW)"; + Text[ arabic ] = " $(ROW)"; + Text[ turkish ] = "Veri dizisi $(ROW)"; + Text[ catalan ] = "Srie de dades $(ROW)"; + Text[ finnish ] = "Tietojoukot $(ROW)"; + Text[ thai ] = "ชุดข้อมูล $(ROW)"; + Text[ czech ] = "Datová řada $(ROW)"; + Text[ hebrew ] = "Datenreihe $(ROW)"; + Text[ hindi ] = "ड़ॉटा श्रृंखला $(पक्तिं)"; + Text[ slovak ] = "Dátový rad $(ROW)"; +}; +String STR_DIAGRAM_DESCRGROUP +{ + Text = "Datenbeschriftungen" ; + Text [ ENGLISH ] = "Data Descriptions" ; + Text [ english_us ] = "Data Labels" ; + Text [ italian ] = "Diciture dati" ; + Text [ spanish ] = "Etiqueta de datos" ; + Text [ french ] = "tiquettes des donnes" ; + Text [ dutch ] = "Gegevenslabels" ; + Text [ swedish ] = "Dataetiketter" ; + Text [ danish ] = "Dataetiketter" ; + Text [ portuguese ] = "Rtulos para dados" ; + Text [ portuguese_brazilian ] = "Rtulos dos Dados" ; + Text[ chinese_simplified ] = "数据标志"; + Text[ russian ] = " "; + Text[ polish ] = "Etykiety danych"; + Text[ japanese ] = "データラベル"; + Text[ chinese_traditional ] = "資料標籤"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "데이터 레이블"; + Text[ turkish ] = "Veri etiketleri"; + Text[ catalan ] = "Etiquetes de dades"; + Text[ finnish ] = "Tietoselitteet"; + Text[ thai ] = "ป้ายชื่อข้อมูล"; + Text[ czech ] = "Popisky dat"; + Text[ hebrew ] = "Datenbeschriftungen"; + Text[ hindi ] = "ड़ॉटा लेबिलें"; + Text[ slovak ] = "Popisy dát"; +}; +String STR_DIAGRAM_DESCR_ROW +{ + Text = "Datenzeilen-Beschriftung" ; + Text [ ENGLISH ] = "Data Description" ; + Text [ english_us ] = "Data rows label" ; + Text [ italian ] = "Dicitura righe di dati" ; + Text [ spanish ] = "Etiqueta fila de datos" ; + Text [ french ] = "tiquette de lignes de donnes" ; + Text [ dutch ] = "Rijlabels" ; + Text [ swedish ] = "Dataradetikett" ; + Text [ danish ] = "Datarkkeetiketter" ; + Text [ portuguese ] = "Legendar srie de dados" ; + Text [ portuguese_brazilian ] = "Rtulo das linhas de dados" ; + Text[ chinese_simplified ] = "数据行标志"; + Text[ russian ] = " "; + Text[ polish ] = "Etykiety wierszy danych"; + Text[ japanese ] = "データ行ラベル"; + Text[ chinese_traditional ] = "數據列標籤"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "데이터 행 레이블"; + Text[ turkish ] = "Veri satr etiketi"; + Text[ catalan ] = "Etiqueta de les files de dades"; + Text[ finnish ] = "Tietorivien selite"; + Text[ thai ] = "ป้ายชื่อแถวข้อมูล"; + Text[ czech ] = "Popisek řádku dat"; + Text[ hebrew ] = "Datenzeilen-Beschriftung"; + Text[ hindi ] = "ड़ॉटा पंक्तियों का लेबिल"; + Text[ slovak ] = "Popisok riadkov dát"; +}; +String STR_DIAGRAM_DESCR_COL +{ + Text = "Datenspalten-Beschriftung" ; + Text [ ENGLISH ] = "Data Description" ; + Text [ dutch ] = "Kolomlabels" ; + Text [ english_us ] = "Data columns label" ; + Text [ italian ] = "Dicitura colonne di dati" ; + Text [ spanish ] = "Etiqueta de columnas de datos" ; + Text [ french ] = "tiquette de colonnes de donnes" ; + Text [ swedish ] = "Datakolumnetikett" ; + Text [ danish ] = "Datakolonneetiketter" ; + Text [ portuguese ] = "Rtulos para colunas de dados" ; + Text [ portuguese_brazilian ] = "Rtulo das colunas de dados" ; + Text[ chinese_simplified ] = "数据列标志"; + Text[ russian ] = " "; + Text[ polish ] = "Etykiety kolumn danych"; + Text[ japanese ] = "データ列ラベル"; + Text[ chinese_traditional ] = "資料列標籤"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "데이터 열 레이블"; + Text[ turkish ] = "Veri stun etiketi"; + Text[ catalan ] = "Etiqueta de les columnes de dades"; + Text[ finnish ] = "Tietosarakkeiden selite"; + Text[ thai ] = "ป้ายชื่อคอลัมน์ข้อมูล"; + Text[ czech ] = "Popisky sloupců dat"; + Text[ hebrew ] = "Datenspalten-Beschriftung"; + Text[ hindi ] = "ड़ॉटा स्तंभों का लेबिल"; + Text[ slovak ] = "Popisok stĺpcov dát"; +}; +String STR_LEGEND +{ + Text = "Legende" ; + Text [ ENGLISH ] = "Legend" ; + Text [ english_us ] = "Legend" ; + Text [ italian ] = "Legenda" ; + Text [ spanish ] = "Leyenda" ; + Text [ french ] = "Lgende" ; + Text [ dutch ] = "Legenda" ; + Text [ swedish ] = "Frklaring" ; + Text [ danish ] = "Forklaring" ; + Text [ portuguese ] = "Legenda" ; + Text [ portuguese_brazilian ] = "Legenda" ; + Text[ chinese_simplified ] = "图例"; + Text[ russian ] = ""; + Text[ polish ] = "Legenda"; + Text[ japanese ] = "凡例"; + Text[ chinese_traditional ] = "圖例"; + Text[ arabic ] = " "; + Text[ greek ] = ""; + Text[ korean ] = "범례"; + Text[ turkish ] = "Aklama"; + Text[ catalan ] = "Llegenda"; + Text[ finnish ] = "Selite"; + Text[ thai ] = "คำอธิบาย"; + Text[ czech ] = "Legenda"; + Text[ hebrew ] = "Legende"; + Text[ hindi ] = "लेजेन्ड़"; + Text[ slovak ] = "Legenda"; +}; +String STR_LEGEND_SYMBOL_ROW +{ + Text = "Datenreihen-Symbol" ; + Text [ ENGLISH ] = "Data Row Symbol" ; + Text [ english_us ] = "Data series symbol" ; + Text [ italian ] = "Simbolo serie di dati" ; + Text [ spanish ] = "Smbolo de series de datos" ; + Text [ french ] = "Symbole de srie de donnes" ; + Text [ dutch ] = "Gegevensreekssymbool" ; + Text [ swedish ] = "Dataseriesymbol" ; + Text [ danish ] = "Dataserie-symbol" ; + Text [ portuguese ] = "Smbolo de sries de dados" ; + Text [ portuguese_brazilian ] = "Smbolo da srie de dados" ; + Text[ chinese_simplified ] = "数据行图标"; + Text[ russian ] = " "; + Text[ polish ] = "Symbol serii danych"; + Text[ japanese ] = "データ系列のシンボル"; + Text[ chinese_traditional ] = "資料欄圖示"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "연속 데이터 기호"; + Text[ turkish ] = "Veri dizisi simgesi"; + Text[ catalan ] = "Smbol de sries de dades"; + Text[ finnish ] = "Tietojoukon symboli"; + Text[ thai ] = "สัญลักษณ์ชุดข้อมูล"; + Text[ czech ] = "Symbol datové řady"; + Text[ hebrew ] = "Datenreihen-Symbol"; + Text[ hindi ] = "ड़ॉटा श्रृंखला संकेत"; + Text[ slovak ] = "Symbol dátového radu"; +}; +String STR_LEGEND_SYMBOL_COL +{ + Text = "Datenspalten-Symbol" ; + Text [ ENGLISH ] = "Data Column Symbol" ; + Text [ dutch ] = "Kolomsymbool" ; + Text [ english_us ] = "Data column symbol" ; + Text [ italian ] = "Simbolo dati colonna" ; + Text [ spanish ] = "Smbolo de columnas de datos" ; + Text [ french ] = "Symbole de colonne de donnes" ; + Text [ swedish ] = "Datakolumnsymbol" ; + Text [ danish ] = "Datakolonnesymbol" ; + Text [ portuguese ] = "Smbolo de colunas de dados" ; + Text [ portuguese_brazilian ] = "Smbolo da coluna de dados" ; + Text[ chinese_simplified ] = "数据列图标"; + Text[ russian ] = " "; + Text[ polish ] = "Symbol kolumny danych"; + Text[ japanese ] = "データ列のシンボル"; + Text[ chinese_traditional ] = "資料列圖示"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "데이터 열 기호"; + Text[ turkish ] = "Veri stunu simgesi"; + Text[ catalan ] = "Smbol de columnes de dades"; + Text[ finnish ] = "Tietosarakkeen symboli"; + Text[ thai ] = "สัญลักษณ์คอลัมน์ข้อมูล"; + Text[ czech ] = "Symbol sloupce dat"; + Text[ hebrew ] = "Datenspalten-Symbol"; + Text[ hindi ] = "Data column symbol"; + Text[ slovak ] = "Symbol stĺpca dát"; +}; + +String STR_MARKED +{ + // $(OBJ) is any chart object, like 'x axis', 'data point', 'grid', etc. + // this string is for the status bar. + Text = "$(OBJ) markiert" ; + Text [ english_us ] = "$(OBJ) selected" ; + Text[ portuguese ] = "$(OBJ) marcado(s)"; + Text[ russian ] = "$(OBJ)"; + Text[ greek ] = " $(OBJ)"; + Text[ dutch ] = "$(OBJ) gemarkeerd"; + Text[ french ] = "$(OBJ) marqu"; + Text[ spanish ] = "$(OBJ) marcado"; + Text[ italian ] = "$(OBJ) evidenziato"; + Text[ danish ] = "$(OBJ) markeret"; + Text[ swedish ] = "$(OBJ) markerat"; + Text[ polish ] = "Zaznaczono $(OBJ) "; + Text[ portuguese_brazilian ] = "$(OBJ) selecionado"; + Text[ japanese ] = "$(OBJ)選択"; + Text[ korean ] = "$(OBJ) 선택표시됨"; + Text[ chinese_simplified ] = "$(OBJ) 被选中"; + Text[ chinese_traditional ] = "$(OBJ) 已被選取"; + Text[ arabic ] = "$(OBJ)"; + Text[ turkish ] = "$(OBJ) iaretli"; + Text[ catalan ] = "$(OBJ) seleccionat"; + Text[ finnish ] = "$(OBJ) valittu"; + Text[ thai ] = "เลือก $(OBJ) "; + Text[ czech ] = "Vybráno: $(OBJ)"; + Text[ hebrew ] = "$(OBJ) markiert"; + Text[ hindi ] = "$(OBJ) को चुना है"; + Text[ slovak ] = "Vybrané: $(OBJ)"; +}; + +String STR_UNDO_DRAGDROP +{ + Text = "Drag&Drop" ; + Text [ ENGLISH ] = "Drag&Drop" ; + Text [ norwegian ] = "Dra&Slipp" ; + Text [ italian ] = "Drag&Drop" ; + Text [ portuguese_brazilian ] = "Arrastar e Soltar" ; + Text [ portuguese ] = "Arrastar&Largar" ; + Text [ finnish ] = "Ved ja pudota" ; + Text [ danish ] = "Trk-og-slip" ; + Text [ french ] = "Glisser-Dposer" ; + Text [ swedish ] = "Dra-och-slpp" ; + Text [ dutch ] = "Slepen & neerzetten" ; + Text [ spanish ] = "Arrastrar y colocar" ; + Text [ english_us ] = "Drag and Drop" ; + Text[ chinese_simplified ] = "拖放"; + Text[ russian ] = ""; + Text[ polish ] = "Przecignij i upu"; + Text[ japanese ] = "ドラック & ドロップ"; + Text[ chinese_traditional ] = "拖曳"; + Text[ arabic ] = " "; + Text[ greek ] = " A"; + Text[ korean ] = "끌어 놓기"; + Text[ turkish ] = "Srkle ve brak"; + Text[ catalan ] = "Arrossega i deixa anar"; + Text[ thai ] = "ลากและปล่อย"; + Text[ czech ] = "Táhni a pusť"; + Text[ hebrew ] = "Drag&Drop"; + Text[ hindi ] = "खींचना और गिराना"; + Text[ slovak ] = "Ťahaj a pusť"; +}; +String STR_UNDO_DIAGRAM_LINE +{ + Text = "Linenart" ; + Text [ ENGLISH ] = "Linetype" ; + Text [ dutch ] = "Lijntype" ; + Text [ english_us ] = "Line Type" ; + Text [ italian ] = "Tipo di linea" ; + Text [ spanish ] = "Tipo de lnea" ; + Text [ french ] = "Type de ligne" ; + Text [ swedish ] = "Linjetyp" ; + Text [ danish ] = "Linjetype" ; + Text [ portuguese ] = "Tipo de linha" ; + Text [ portuguese_brazilian ] = "Tipo da Linha" ; + Text[ chinese_simplified ] = "线条类型"; + Text[ russian ] = " "; + Text[ polish ] = "Typ linii"; + Text[ japanese ] = "線のスタイル"; + Text[ chinese_traditional ] = "線條類型"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "선 형태"; + Text[ turkish ] = "izgi tr"; + Text[ catalan ] = "Tipus de lnia"; + Text[ finnish ] = "Viivatyyppi"; + Text[ thai ] = "ชนิดบรรทัด"; + Text[ czech ] = "Typ čáry"; + Text[ hebrew ] = "Linenart"; + Text[ hindi ] = "Line Type"; + Text[ slovak ] = "Typ čiary"; +}; +String STR_UNDO_CUT +{ + Text = "Ausschneiden" ; + Text [ ENGLISH ] = "Cut" ; + Text [ norwegian ] = "Cut" ; + Text [ italian ] = "Taglia" ; + Text [ portuguese_brazilian ] = "Cortar" ; + Text [ portuguese ] = "Cortar" ; + Text [ finnish ] = "Leikkaa" ; + Text [ danish ] = "Klip" ; + Text [ french ] = "Couper" ; + Text [ swedish ] = "Klipp ut" ; + Text [ dutch ] = "Knippen" ; + Text [ spanish ] = "Cortar" ; + Text [ english_us ] = "Cut" ; + Text[ chinese_simplified ] = "剪切"; + Text[ russian ] = ""; + Text[ polish ] = "Wytnij"; + Text[ japanese ] = "切り取り"; + Text[ chinese_traditional ] = "剪下"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "잘라내기"; + Text[ turkish ] = "Kes"; + Text[ catalan ] = "Retalla"; + Text[ thai ] = "ตัด"; + Text[ czech ] = "Vyjmout"; + Text[ hebrew ] = "גזירה"; + Text[ hindi ] = "काटो"; + Text[ slovak ] = "Vybrať"; +}; +String STR_UNDO_DELETE +{ + Text = "Lschen" ; + Text [ ENGLISH ] = "Delete" ; + Text [ english_us ] = "Delete" ; + Text [ italian ] = "Elimina" ; + Text [ spanish ] = "Borrar" ; + Text [ french ] = "Supprimer" ; + Text [ dutch ] = "Wissen" ; + Text [ swedish ] = "Radera" ; + Text [ danish ] = "Slet" ; + Text [ portuguese ] = "Eliminar" ; + Text [ portuguese_brazilian ] = "Excluir" ; + Text[ chinese_simplified ] = "删除"; + Text[ russian ] = ""; + Text[ polish ] = "Usu"; + Text[ japanese ] = "削除"; + Text[ chinese_traditional ] = "刪除"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "삭제"; + Text[ turkish ] = "Sil"; + Text[ catalan ] = "Suprimeix"; + Text[ finnish ] = "Poista"; + Text[ thai ] = "ลบ"; + Text[ czech ] = "Smazat"; + Text[ hebrew ] = "מחיקה"; + Text[ hindi ] = "मिटाओ"; + Text[ slovak ] = "Zmazať"; +}; +String STR_UNDO_DIAGRAM_DATA +{ + Text = "Diagrammdaten bearbeiten" ; + Text [ ENGLISH ] = "Modify diagram data" ; + Text [ english_us ] = "Edit chart data" ; + Text [ italian ] = "Modifica dati di diagramma" ; + Text [ spanish ] = "Editar datos del diagrama" ; + Text [ french ] = "diter les donnes du diagramme" ; + Text [ dutch ] = "Diagramgegevens bewerken" ; + Text [ swedish ] = "Redigera diagramdata" ; + Text [ danish ] = "Rediger diagramdata" ; + Text [ portuguese ] = "Editar dados do grfico" ; + Text [ portuguese_brazilian ] = "Editar dados do grfico" ; + Text[ chinese_simplified ] = "编辑图表数据"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj dane wykresu"; + Text[ japanese ] = "グラフ データの編集"; + Text[ chinese_traditional ] = "編輯圖表資料"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "차트 데이터 편집"; + Text[ turkish ] = "ema verileri dzenle"; + Text[ catalan ] = "Edita les dades del diagrama"; + Text[ finnish ] = "Muokkaa kaaviotietoja"; + Text[ thai ] = "แก้ไขข้อมูลของแผนภูมิ"; + Text[ czech ] = "Upravit data grafu"; + Text[ hebrew ] = "Diagrammdaten bearbeiten"; + Text[ hindi ] = "चार्ट ड़ॉटा संपादन"; + Text[ slovak ] = "Upraviť dáta grafu"; +}; +String STR_UNDO_EDIT_TITLE +{ + Text = "Titel editieren" ; + Text [ ENGLISH ] = "Edit Title" ; + Text [ english_us ] = "Edit title" ; + Text [ italian ] = "Editare titolo" ; + Text [ spanish ] = "Editar ttulo" ; + Text [ french ] = "diter le titre" ; + Text [ dutch ] = "Titel bewerken" ; + Text [ swedish ] = "Redigera rubrik" ; + Text [ danish ] = "Rediger titel" ; + Text [ portuguese ] = "Editar ttulo" ; + Text [ portuguese_brazilian ] = "Editar ttulo" ; + Text[ chinese_simplified ] = "编辑标题"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj tytu"; + Text[ japanese ] = "タイトルの編集"; + Text[ chinese_traditional ] = "編輯標題"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "제목 편집"; + Text[ turkish ] = "Balk dzenle"; + Text[ catalan ] = "Edita ttol"; + Text[ finnish ] = "Muokkaa otsikkoa"; + Text[ thai ] = "แก้ไขชื่อ"; + Text[ czech ] = "Upravit titul"; + Text[ hebrew ] = "Titel editieren"; + Text[ hindi ] = "शीर्षक संपादन"; + Text[ slovak ] = "Upraviť nadpis"; +}; +String STR_UNDO_STATISTICS +{ + Text = "Statistik" ; + Text [ ENGLISH ] = "Statistics" ; + Text [ english_us ] = "Statistics" ; + Text [ italian ] = "Statistiche" ; + Text [ spanish ] = "Estadstica" ; + Text [ french ] = "Statistiques" ; + Text [ dutch ] = "Statistiek" ; + Text [ swedish ] = "Statistik" ; + Text [ danish ] = "Statistik" ; + Text [ portuguese ] = "Estatstica" ; + Text [ portuguese_brazilian ] = "Estatsticas" ; + Text[ chinese_simplified ] = "统计"; + Text[ russian ] = ""; + Text[ polish ] = "Statystyka"; + Text[ japanese ] = "詳細情報"; + Text[ chinese_traditional ] = "統計"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "통계"; + Text[ turkish ] = "statistik"; + Text[ catalan ] = "Estadstica"; + Text[ finnish ] = "Tilastotiedot"; + Text[ thai ] = "สถิติ"; + Text[ czech ] = "Statistika"; + Text[ hebrew ] = "סטטיסטיקות"; + Text[ hindi ] = "अँकड़े"; + Text[ slovak ] = "Štatistika"; +}; +String STR_UNDO_INSERT_TITLE +{ + Text = "Titel einfgen" ; + Text [ ENGLISH ] = "Insert Title" ; + Text [ norwegian ] = "Sett inn Tittel" ; + Text [ italian ] = "Inserisci titolo" ; + Text [ portuguese_brazilian ] = "Inserir ttulo" ; + Text [ portuguese ] = "Inserir ttulo" ; + Text [ finnish ] = "Lis otsikko" ; + Text [ danish ] = "Indst titel" ; + Text [ french ] = "Insrer un titre" ; + Text [ swedish ] = "Infoga rubrik" ; + Text [ dutch ] = "Titel invoegen" ; + Text [ spanish ] = "Insertar ttulo" ; + Text [ english_us ] = "Insert title" ; + Text[ chinese_simplified ] = "插入标题"; + Text[ russian ] = " "; + Text[ polish ] = "Wstaw tytu"; + Text[ japanese ] = "タイトルの挿入"; + Text[ chinese_traditional ] = "插入標題"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "제목 삽입"; + Text[ turkish ] = "Balk ekle"; + Text[ catalan ] = "Insereix ttol"; + Text[ thai ] = "แทรกชื่อ"; + Text[ czech ] = "Vložit titulek"; + Text[ hebrew ] = "Titel einfügen"; + Text[ hindi ] = "शीर्षक जोड़ो"; + Text[ slovak ] = "Vložiť titulok"; +}; +String STR_UNDO_INSERT_LEGEND +{ + Text = "Legende einfgen" ; + Text [ ENGLISH ] = "Insert legend" ; + Text [ norwegian ] = "Setter inn tegnforklaring" ; + Text [ italian ] = "Inserisci legenda" ; + Text [ portuguese_brazilian ] = "Inserir legenda" ; + Text [ portuguese ] = "Inserir legenda" ; + Text [ finnish ] = "Lis selite" ; + Text [ danish ] = "Indst forklaring" ; + Text [ french ] = "Insrer une lgende" ; + Text [ swedish ] = "Infoga frklaring" ; + Text [ dutch ] = "Legenda invoegen" ; + Text [ spanish ] = "Insertar leyenda" ; + Text [ english_us ] = "Insert legend" ; + Text[ chinese_simplified ] = "插入图例"; + Text[ russian ] = " "; + Text[ polish ] = "Wstaw legend"; + Text[ japanese ] = "凡例の挿入"; + Text[ chinese_traditional ] = "插入圖例"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "범례 삽입"; + Text[ turkish ] = "Aklama ekle"; + Text[ catalan ] = "Insereix una llegenda"; + Text[ thai ] = "แทรกคำอธิบาย"; + Text[ czech ] = "Vložit legendu"; + Text[ hebrew ] = "Legende einfügen"; + Text[ hindi ] = "लेजन्ड जोड़ो"; + Text[ slovak ] = "Vložiť legendu"; +}; +String STR_UNDO_INSERT_DESCR +{ + Text = "Datenbeschriftung einfgen" ; + Text [ ENGLISH ] = "Insert data description" ; + Text [ norwegian ] = "Setter inn data beskrivelse" ; + Text [ italian ] = "Inserisci dicitura dati" ; + Text [ portuguese_brazilian ] = "Inserir rtulo dos dados" ; + Text [ portuguese ] = "Inserir legenda para dados" ; + Text [ finnish ] = "Lis tietoselite" ; + Text [ danish ] = "Indst dataetiket" ; + Text [ french ] = "Insrer des tiquettes de donnes" ; + Text [ swedish ] = "Infoga dataetikett" ; + Text [ dutch ] = "Gegevenslabels invoegen" ; + Text [ spanish ] = "Insertar etiqueta de datos" ; + Text [ english_us ] = "Insert data label" ; + Text[ chinese_simplified ] = "插入数据标志"; + Text[ russian ] = " "; + Text[ polish ] = "Wstaw etykiet danych"; + Text[ japanese ] = "データラベルの挿入"; + Text[ chinese_traditional ] = "插入資料標籤"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "데이터 레이블 삽입"; + Text[ turkish ] = "Veri etiketi ekle"; + Text[ catalan ] = "Insereix l'etiqueta de les dades"; + Text[ thai ] = "แทรกป้ายชื่อข้อมูล"; + Text[ czech ] = "Vložit popis dat"; + Text[ hebrew ] = "Datenbeschriftung einfügen"; + Text[ hindi ] = "Insert data label"; + Text[ slovak ] = "Vložiť dátové značky"; +}; +String STR_UNDO_INSERT_AXIS +{ + Text = "Achsen einfgen" ; + Text [ ENGLISH ] = "Insert axes" ; + Text [ english_us ] = "Insert axes" ; + Text[ portuguese ] = "Inserir eixos"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "Assen invoegen"; + Text[ french ] = "Insrer des axes"; + Text[ spanish ] = "Insertar ejes"; + Text[ italian ] = "Inserisci assi"; + Text[ danish ] = "Indst akser"; + Text[ swedish ] = "Infoga axlar"; + Text[ polish ] = "Wstaw osie"; + Text[ portuguese_brazilian ] = "Inserir eixos"; + Text[ japanese ] = "軸と目盛線の挿入"; + Text[ korean ] = "축 삽입"; + Text[ chinese_simplified ] = "插入轴"; + Text[ chinese_traditional ] = "插入軸"; + Text[ arabic ] = " "; + Text[ turkish ] = "Eksen ekle"; + Text[ catalan ] = "Insereix els eixos"; + Text[ finnish ] = "Lis akselit"; + Text[ thai ] = "แทรกแกน"; + Text[ czech ] = "Vložit osy"; + Text[ hebrew ] = "Achsen einfügen"; + Text[ hindi ] = "Insert axes"; + Text[ slovak ] = "Vložiť osi"; +}; +String STR_UNDO_INSERT_GRID +{ + Text = "Gitter einfgen" ; + Text [ ENGLISH ] = "Insert grids" ; + Text [ english_us ] = "Insert grids" ; + Text[ portuguese ] = "Inserir grelhas"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "Raster invoegen"; + Text[ french ] = "Insrer des grilles"; + Text[ spanish ] = "Insertar cuadrculas"; + Text[ italian ] = "Inserisci griglie"; + Text[ danish ] = "Indst gitre"; + Text[ swedish ] = "Infoga gitter"; + Text[ polish ] = "Wstaw siatki"; + Text[ portuguese_brazilian ] = "Inserir grades"; + Text[ japanese ] = "目盛線の挿入"; + Text[ korean ] = "눈금선 삽입"; + Text[ chinese_simplified ] = "插入网格线"; + Text[ chinese_traditional ] = "插入網格"; + Text[ arabic ] = " "; + Text[ turkish ] = "Klavuz ekle"; + Text[ catalan ] = "Insereix les graelles"; + Text[ finnish ] = "Lis ruudukot"; + Text[ thai ] = "แทรกเส้นตาราง"; + Text[ czech ] = "Vložit mřížky"; + Text[ hebrew ] = "Gitter einfügen"; + Text[ hindi ] = "Insert grids"; + Text[ slovak ] = "Vložiť mriežky"; +}; +String STR_UNDO_DATA_ROW +{ + Text = "Datenreihe bearbeiten" ; + Text [ ENGLISH ] = "Modify dataline" ; + Text [ norwegian ] = "Endrer datalinje" ; + Text [ italian ] = "Modifica serie di dati" ; + Text [ portuguese_brazilian ] = "Editar srie de dados" ; + Text [ portuguese ] = "Editar linha de dados" ; + Text [ finnish ] = "Muokkaa tietojoukkoja" ; + Text [ danish ] = "Rediger dataserie" ; + Text [ french ] = "diter la srie de donnes" ; + Text [ swedish ] = "Redigera dataserie" ; + Text [ dutch ] = "Gegevensreeks wijzigen" ; + Text [ spanish ] = "Editar serie de datos" ; + Text [ english_us ] = "Edit data series" ; + Text[ chinese_simplified ] = "编辑数据组"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj seri danych"; + Text[ japanese ] = "データ系列の編集"; + Text[ chinese_traditional ] = "編輯資料欄"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "연속 데이터 편집"; + Text[ turkish ] = "Veri dizisi dzenle"; + Text[ catalan ] = "Edita srie de dades"; + Text[ thai ] = "แก้ไขชุดข้อมูล"; + Text[ czech ] = "Upravit datovou řadu"; + Text[ hebrew ] = "Datenreihe bearbeiten"; + Text[ hindi ] = "डॉटा श्रृंखला संपादन"; + Text[ slovak ] = "Upraviť dátový rad"; +}; +String STR_UNDO_DATA_POINT +{ + Text = "Datenpunkt bearbeiten" ; + Text [ ENGLISH ] = "Modify datapoint" ; + Text [ norwegian ] = "Endrer datapunkt" ; + Text [ italian ] = "Modifica punto dati" ; + Text [ portuguese_brazilian ] = "Editar ponto dos dados" ; + Text [ portuguese ] = "Editar ponto de dados" ; + Text [ finnish ] = "Muokkaa arvopistett" ; + Text [ danish ] = "Rediger datapunkt" ; + Text [ french ] = "diter le point de donnes" ; + Text [ swedish ] = "Redigera datapunkt" ; + Text [ dutch ] = "Gegevenspunt bewerken" ; + Text [ spanish ] = "Editar punto de datos" ; + Text [ english_us ] = "Edit data point" ; + Text[ chinese_simplified ] = "编辑数据点"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj punkt danych"; + Text[ japanese ] = "データポイントの編集"; + Text[ chinese_traditional ] = "編輯資料點"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "데이터 포인트 편집"; + Text[ turkish ] = "Veri noktas dzenle"; + Text[ catalan ] = "Edita el punt de dades"; + Text[ thai ] = "แก้ไขจุดข้อมูล"; + Text[ czech ] = "Upravit datový bod"; + Text[ hebrew ] = "Datenpunkt bearbeiten"; + Text[ hindi ] = "डॉटा बिन्दु संपादन"; + Text[ slovak ] = "Upraviť dátový bod"; +}; +String STR_UNDO_TITLE +{ + Text = "Titel bearbeiten" ; + Text [ ENGLISH ] = "Modify title" ; + Text [ norwegian ] = "Endrer tittel" ; + Text [ italian ] = "Modifica titolo" ; + Text [ portuguese_brazilian ] = "Editar ttulo" ; + Text [ portuguese ] = "Editar ttulo" ; + Text [ finnish ] = "Muokkaa otsikkoa" ; + Text [ danish ] = "Rediger titel" ; + Text [ french ] = "diter le titre" ; + Text [ swedish ] = "Redigera rubrik" ; + Text [ dutch ] = "Titel bewerken" ; + Text [ spanish ] = "Editar ttulo" ; + Text [ english_us ] = "Edit title" ; + Text[ chinese_simplified ] = "编辑标题"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj tytu"; + Text[ japanese ] = "タイトルの編集"; + Text[ chinese_traditional ] = "編輯標題"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "제목 편집"; + Text[ turkish ] = "Balk dzenle"; + Text[ catalan ] = "Edita ttol"; + Text[ thai ] = "แก้ไขชื่อ"; + Text[ czech ] = "Upravit titul"; + Text[ hebrew ] = "Titel bearbeiten"; + Text[ hindi ] = "Edit title"; + Text[ slovak ] = "Upraviť nadpis"; +}; +String STR_UNDO_LEGEND +{ + Text = "Legende bearbeiten" ; + Text [ ENGLISH ] = "Modify legend" ; + Text [ norwegian ] = "Endrer tegnforklaring" ; + Text [ italian ] = "Modifica legenda" ; + Text [ portuguese_brazilian ] = "Editar legenda" ; + Text [ portuguese ] = "Editar legenda" ; + Text [ finnish ] = "Muokkaa selitett" ; + Text [ danish ] = "Rediger forklaring" ; + Text [ french ] = "diter la lgende" ; + Text [ swedish ] = "Redigera frklaring" ; + Text [ dutch ] = "Legenda bewerken" ; + Text [ spanish ] = "Editar leyenda" ; + Text [ english_us ] = "Edit legend" ; + Text[ chinese_simplified ] = "编辑图例"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj legend"; + Text[ japanese ] = "凡例の編集"; + Text[ chinese_traditional ] = "編輯圖例"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "범례 편집"; + Text[ turkish ] = "Aklama dzenle"; + Text[ catalan ] = "Edita la llegenda"; + Text[ thai ] = "แก้ไขคำอธิบาย"; + Text[ czech ] = "Upravit legendu"; + Text[ hebrew ] = "Legende bearbeiten"; + Text[ hindi ] = "लेजन्ड़ संपादन"; + Text[ slovak ] = "Upraviť legendu"; +}; +String STR_UNDO_DIAGRAM_AXIS +{ + Text = "Achse bearbeiten" ; + Text [ ENGLISH ] = "Modify axis" ; + Text [ norwegian ] = "Endrer akse" ; + Text [ italian ] = "Modifica asse" ; + Text [ portuguese_brazilian ] = "Editar eixo" ; + Text [ portuguese ] = "Editar eixo" ; + Text [ finnish ] = "Muokkaa akselia" ; + Text [ danish ] = "Rediger akse" ; + Text [ french ] = "diter l'axe" ; + Text [ swedish ] = "Redigera axel" ; + Text [ dutch ] = "As wijzigen" ; + Text [ spanish ] = "Modificar ejes" ; + Text [ english_us ] = "Edit axis" ; + Text[ chinese_simplified ] = "编辑轴数值"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj osie"; + Text[ japanese ] = "軸の編集"; + Text[ chinese_traditional ] = "編輯軸"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "축 편집"; + Text[ turkish ] = "Ekseni dzenle"; + Text[ catalan ] = "Edita l'eix"; + Text[ thai ] = "แก้ไขแกน"; + Text[ czech ] = "Upravit osu"; + Text[ hebrew ] = "Achse bearbeiten"; + Text[ hindi ] = "अक्ष संपादन"; + Text[ slovak ] = "Upraviť os"; +}; +String STR_UNDO_DIAGRAM_GRID +{ + Text = "Gitter bearbeiten" ; + Text [ ENGLISH ] = "Modify grid" ; + Text [ norwegian ] = "Endrer rutenett" ; + Text [ italian ] = "Modifica griglia" ; + Text [ portuguese_brazilian ] = "Editar grade" ; + Text [ portuguese ] = "Editar grelha" ; + Text [ finnish ] = "Muokkaa ruudukkoa" ; + Text [ danish ] = "Rediger gitter" ; + Text [ french ] = "diter la grille" ; + Text [ swedish ] = "Redigera gitter" ; + Text [ dutch ] = "Raster bewerken" ; + Text [ spanish ] = "Editar cuadrcula" ; + Text [ english_us ] = "Edit grid" ; + Text[ chinese_simplified ] = "编辑网格线"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj siatk"; + Text[ japanese ] = "目盛線の編集"; + Text[ chinese_traditional ] = "編輯網格線"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "눈금선 편집"; + Text[ turkish ] = "Klavuz izgileri dzenle"; + Text[ catalan ] = "Edita la graella"; + Text[ thai ] = "แก้ไขเส้นตาราง"; + Text[ czech ] = "Upravit mřížku"; + Text[ hebrew ] = "Gitter bearbeiten"; + Text[ hindi ] = "जाल संपादन"; + Text[ slovak ] = "Upraviť mriežku"; +}; +String STR_UNDO_DIAGRAM_WALL +{ + Text = "Diagrammwand bearbeiten" ; + Text [ ENGLISH ] = "Modify diagram wall" ; + Text [ norwegian ] = "Endrer diagram vegg" ; + Text [ italian ] = "Modifica parete del diagramma" ; + Text [ portuguese_brazilian ] = "Editar parede do grfico" ; + Text [ portuguese ] = "Editar parede do grfico" ; + Text [ finnish ] = "Muokkaa kaaviosein" ; + Text [ danish ] = "Rediger diagramvg" ; + Text [ french ] = "diter la paroi du diagramme" ; + Text [ swedish ] = "Redigera diagramvgg" ; + Text [ dutch ] = "Diagramwand bewerken" ; + Text [ spanish ] = "Editar plano lateral" ; + Text [ english_us ] = "Edit chart wall" ; + Text[ chinese_simplified ] = "编辑图表背景墙"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj cian wykresu"; + Text[ japanese ] = "グラフの壁面の編集"; + Text[ chinese_traditional ] = "編輯圖表背景牆"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "차트 옆면 수정"; + Text[ turkish ] = "ema duvarn dzenle"; + Text[ catalan ] = "Edita el pla lateral del diagrama"; + Text[ thai ] = "แก้ไขผนังแผนภูมิ"; + Text[ czech ] = "Upravit stěnu grafu"; + Text[ hebrew ] = "Diagrammwand bearbeiten"; + Text[ hindi ] = "चार्ट वॉल संपादन"; + Text[ slovak ] = "Upraviť bok grafu"; +}; +String STR_UNDO_DIAGRAM_FLOOR +{ + Text = "Diagrammboden bearbeiten" ; + Text [ ENGLISH ] = "Modify diagram floor" ; + Text [ norwegian ] = "Endrer diagram gulv" ; + Text [ italian ] = "Modifica pavimento del diagramma" ; + Text [ portuguese_brazilian ] = "Editar piso do grfico" ; + Text [ portuguese ] = "Editar base do grfico" ; + Text [ finnish ] = "Muokkaa kaavioperustaa" ; + Text [ danish ] = "Rediger diagramgulv" ; + Text [ french ] = "diter le plancher du diagramme" ; + Text [ swedish ] = "Redigera diagramgolv" ; + Text [ dutch ] = "Diagrambodem bewerken" ; + Text [ spanish ] = "Editar plano inferior" ; + Text [ english_us ] = "Edit chart floor" ; + Text[ chinese_simplified ] = "编辑图表基底"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj podstaw wykresu"; + Text[ japanese ] = "グラフの床面の編集"; + Text[ chinese_traditional ] = "編輯座標軸"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "차트 밑면 편집"; + Text[ turkish ] = "ema tabann dzenle"; + Text[ catalan ] = "Edita la base del diagrama"; + Text[ thai ] = "แก้ไขพื้นแผนภูมิ"; + Text[ czech ] = "Upravit patu grafu"; + Text[ hebrew ] = "Diagrammboden bearbeiten"; + Text[ hindi ] = "चार्ट फ़्लॉर संपादन"; + Text[ slovak ] = "Upraviť pätu grafu"; +}; +String STR_UNDO_DIAGRAM_AREA +{ + Text = "Diagrammflche bearbeiten" ; + Text [ ENGLISH ] = "Modify diagram area" ; + Text [ norwegian ] = "Endrer diagram omrde" ; + Text [ italian ] = "Modifica area diagramma" ; + Text [ portuguese_brazilian ] = "Editar rea do grfico" ; + Text [ portuguese ] = "Editar rea do grfico" ; + Text [ finnish ] = "Muokkaa kaavioaluetta" ; + Text [ danish ] = "Rediger diagramomrde" ; + Text [ french ] = "diter l'arrire-plan du diagramme" ; + Text [ swedish ] = "Redigera diagramomrde" ; + Text [ dutch ] = "Diagramoppervlak wijzigen" ; + Text [ spanish ] = "Editar la superficie del diagrama" ; + Text [ english_us ] = "Edit chart area" ; + Text[ chinese_simplified ] = "编辑图表区"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj obszar wykresu"; + Text[ japanese ] = "グラフエリアの編集"; + Text[ chinese_traditional ] = "編輯圖表平面"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "차트 영역 편집"; + Text[ turkish ] = "ema yzeyini dzenle"; + Text[ catalan ] = "Edita rea de diagrama"; + Text[ thai ] = "แก้ไขพื้นที่แผนภูมิ"; + Text[ czech ] = "Upravit oblast grafu"; + Text[ hebrew ] = "Diagrammfläche bearbeiten"; + Text[ hindi ] = "चार्ट विस्तीर्ण संपादन"; + Text[ slovak ] = "Upraviť plochu grafu"; +}; +String STR_UNDO_DIAGRAM_TYPE +{ + Text = "Diagrammtyp bearbeiten" ; + Text [ ENGLISH ] = "Modify diagram type" ; + Text [ norwegian ] = "Endrer diagram type" ; + Text [ italian ] = "Modifica tipo di diagramma" ; + Text [ portuguese_brazilian ] = "Editar tipo do grfico" ; + Text [ portuguese ] = "Editar tipo de grfico" ; + Text [ finnish ] = "Muokkaa kaaviotyyppi" ; + Text [ danish ] = "Rediger diagramtype" ; + Text [ french ] = "diter le type de diagramme" ; + Text [ swedish ] = "Redigera diagramtyp" ; + Text [ dutch ] = "Diagramtype wijzigen" ; + Text [ spanish ] = "Editar tipo de diagrama" ; + Text [ english_us ] = "Edit chart type" ; + Text[ chinese_simplified ] = "编辑图表类型"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj typ wykresu"; + Text[ japanese ] = "グラフの種類の編集"; + Text[ chinese_traditional ] = "編輯圖表類型"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "차트 유형 편집"; + Text[ turkish ] = "ema tipini dzenle"; + Text[ catalan ] = "Edita el tipus de diagrama"; + Text[ thai ] = "แก้ไขชนิดแผนภูมิ"; + Text[ czech ] = "Upravit typ grafu"; + Text[ hebrew ] = "Diagrammtyp bearbeiten"; + Text[ hindi ] = "चार्ट वर्ग संपादन"; + Text[ slovak ] = "Upraviť typ grafu"; +}; +String STR_UNDO_AUTOFORMAT +{ + Text = "AutoFormat" ; + Text [ ENGLISH ] = "AutoFormat" ; + Text [ dutch ] = "AutoOpmaak" ; + Text [ english_us ] = "AutoFormat" ; + Text [ italian ] = "Formattazione automatica" ; + Text [ spanish ] = "Formateado automtico" ; + Text [ french ] = "AutoFormat" ; + Text [ swedish ] = "Autoformat" ; + Text [ danish ] = "AutoFormat" ; + Text [ portuguese ] = "AutoFormato" ; + Text [ portuguese_brazilian ] = "AutoFormatao" ; + Text[ chinese_simplified ] = "自动格式"; + Text[ russian ] = ""; + Text[ polish ] = "Autoformatowanie"; + Text[ japanese ] = "オートフォーマット"; + Text[ chinese_traditional ] = "自動格式"; + Text[ arabic ] = " "; + Text[ greek ] = ""; + Text[ korean ] = "자동 서식"; + Text[ turkish ] = "Otomatik formatlama"; + Text[ catalan ] = "AutoFormat"; + Text[ finnish ] = "Automaattinen muotoilu"; + Text[ thai ] = "รูปแบบอัตโนมัติ"; + Text[ czech ] = "Automatický formát"; + Text[ hebrew ] = "עיצוב אוטומטי"; + Text[ hindi ] = "स्वचालित ढंग से रचना"; + Text[ slovak ] = "Automatický formát"; +}; +String STR_UNDO_3D_VIEW +{ + Text = "3D-Ansicht bearbeiten" ; + Text [ ENGLISH ] = "Modify 3D view" ; + Text [ norwegian ] = "Endrer vis 3D " ; + Text [ italian ] = "Modifica vista 3D" ; + Text [ portuguese_brazilian ] = "Editar visualizao 3D" ; + Text [ portuguese ] = "Editar vista 3D" ; + Text [ finnish ] = "Muokkaa kolmiulotteista nkym" ; + Text [ danish ] = "Rediger 3D-visning" ; + Text [ french ] = "diter l'affichage 3D" ; + Text [ swedish ] = "Redigera 3D-vy" ; + Text [ dutch ] = "3D-weergave bewerken" ; + Text [ spanish ] = "Editar la visualizacin en 3D" ; + Text [ english_us ] = "Edit 3D view" ; + Text[ chinese_simplified ] = "编辑 3 维视图"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj widok 3D"; + Text[ japanese ] = "3D 表示の編集"; + Text[ chinese_traditional ] = "編輯 3D 檢視"; + Text[ arabic ] = " "; + Text[ greek ] = " 3"; + Text[ korean ] = "3D 보기 편집"; + Text[ turkish ] = "3B grnmn dzenle"; + Text[ catalan ] = "Edita la vista 3D"; + Text[ thai ] = "แก้ไขมุมมอง 3มิติ"; + Text[ czech ] = "Upravit 3D pohled"; + Text[ hebrew ] = "3D-Ansicht bearbeiten"; + Text[ hindi ] = "3D दृश्य संपादन"; + Text[ slovak ] = "Upraviť 3D zobrazenie"; +}; +String STR_UNDO_LIGHTING +{ + Text = "3D-Beleuchtung einstellen" ; + Text [ ENGLISH ] = "Modify 3D lighting..." ; + Text [ norwegian ] = "Endrer belysning 3D..." ; + Text [ italian ] = "Modifica illuminazione tridimensionale..." ; + Text [ portuguese_brazilian ] = "Definir iluminao 3D" ; + Text [ portuguese ] = "Definir iluminao 3D..." ; + Text [ finnish ] = "Mrit 3D-valaistus" ; + Text [ danish ] = "Indstil 3D-belysning" ; + Text [ french ] = "Rgler l'clairage 3D..." ; + Text [ swedish ] = "Stll in 3D-belysning" ; + Text [ dutch ] = "3D-belichting instellen" ; + Text [ spanish ] = "Ajustar iluminacin 3D" ; + Text [ english_us ] = "Set 3D illumination" ; + Text[ chinese_simplified ] = "设定 3 维照明"; + Text[ russian ] = " "; + Text[ polish ] = "Ustaw owietlenie 3D"; + Text[ japanese ] = "3D 体照明の設定"; + Text[ chinese_traditional ] = "設定 3D 照明"; + Text[ arabic ] = " "; + Text[ greek ] = " 3"; + Text[ korean ] = "3D 조명 설정"; + Text[ turkish ] = "3B aydnlatmasn ayarla"; + Text[ catalan ] = "Ajusta il.luminaci 3D"; + Text[ thai ] = "กำหนดระดับความสว่าง 3มิติ"; + Text[ czech ] = "Nastavit 3D osvětlení"; + Text[ hebrew ] = "3D-Beleuchtung einstellen"; + Text[ hindi ] = "3D चमक सेट्ट करो"; + Text[ slovak ] = "Nastaviť 3D osvetlenie"; +}; +String STR_UNDO_TOGGLE_TITLE +{ + Text = "Titel ein/aus" ; + Text [ ENGLISH ] = "Title on/off" ; + Text [ english_us ] = "Title on/off" ; + Text [ italian ] = "Mostra/nascondi il titolo" ; + Text [ spanish ] = "Mostrar/ocultar ttulo" ; + Text [ french ] = "Afficher/masquer le titre" ; + Text [ dutch ] = "Titel aan/uit" ; + Text [ swedish ] = "Rubrik p/av" ; + Text [ danish ] = "Titel til/fra" ; + Text [ portuguese ] = "Activar/Desactivar ttulo" ; + Text [ portuguese_brazilian ] = "Ativar/desativar Titulo" ; + Text[ chinese_simplified ] = "显示或隐入标题"; + Text[ russian ] = ""; + Text[ polish ] = "Wcz/Wycz tytu"; + Text[ japanese ] = "タイトル オン/オフ"; + Text[ chinese_traditional ] = "顯示/隱入標題"; + Text[ arabic ] = "/ "; + Text[ greek ] = " /"; + Text[ korean ] = "제목 적용/해제"; + Text[ turkish ] = "Bal grntle/gizle"; + Text[ catalan ] = "Mostra/oculta ttol"; + Text[ finnish ] = "Otsikko kytss / poissa kytst"; + Text[ thai ] = "ชื่อ มี/ไม่มี"; + Text[ czech ] = "Titul zap/vyp"; + Text[ hebrew ] = "Titel ein/aus"; + Text[ hindi ] = "Title on/off"; + Text[ slovak ] = "Zapnúť/vypnúť nadpis"; +}; +String STR_UNDO_TOGGLE_LEGEND +{ + Text = "Legende ein/aus" ; + Text [ ENGLISH ] = "Legend on/off" ; + Text [ dutch ] = "Legenda aan/uit" ; + Text [ english_us ] = "Legend on/off" ; + Text [ italian ] = "Mostra/nascondi legenda" ; + Text [ spanish ] = "Mostrar/ocultar leyenda" ; + Text [ french ] = "Afficher/masquer la lgende" ; + Text [ swedish ] = "Frklaring p/av" ; + Text [ danish ] = "Forklaring til/fra" ; + Text [ portuguese ] = "Activar/Desactivar legenda" ; + Text [ portuguese_brazilian ] = "Ativar/desativar Legenda" ; + Text[ chinese_simplified ] = "显示或隐入图例"; + Text[ russian ] = ""; + Text[ polish ] = "Wcz/wycz legend"; + Text[ japanese ] = "凡例 オン/オフ"; + Text[ chinese_traditional ] = "顯示/隱入圖例"; + Text[ arabic ] = "/ "; + Text[ greek ] = " /"; + Text[ korean ] = "범례 적용/적용안함"; + Text[ turkish ] = "Aklamay grntle/gizle"; + Text[ catalan ] = "Llegenda activada/desactivada"; + Text[ finnish ] = "Selite kytss / poissa kytst"; + Text[ thai ] = "คำอธิบาย มี/ไม่มี"; + Text[ czech ] = "Legenda zap/vyp"; + Text[ hebrew ] = "Legende ein/aus"; + Text[ hindi ] = "लेजन्ड शुरु/बंद"; + Text[ slovak ] = "Zapnúť/vypnúť legendu"; +}; +String STR_UNDO_TOGGLE_AXIS_TITLE +{ + Text = "Achsentitel ein/aus" ; + Text [ ENGLISH ] = "Axis Title on/off" ; + Text [ dutch ] = "Astitels aan/uit" ; + Text [ english_us ] = "Axis titles on/off" ; + Text [ italian ] = "Mostra/nascondi il titolo degli assi" ; + Text [ spanish ] = "Mostrar/ocultar los ttulos de ejes" ; + Text [ french ] = "Afficher/masquer les titres des axes" ; + Text [ swedish ] = "Axelrubrik p/av" ; + Text [ danish ] = "Aksetitler til/fra" ; + Text [ portuguese ] = "Activar/Desactivar ttulo dos eixos" ; + Text [ portuguese_brazilian ] = "Ativar/desativar ttulos do eixo" ; + Text[ chinese_simplified ] = "显示或隐入轴标题"; + Text[ russian ] = " "; + Text[ polish ] = "Wcz/wycz tytuy osi"; + Text[ japanese ] = "軸のタイトル オン/オフ"; + Text[ chinese_traditional ] = "顯示/隱入軸標題"; + Text[ arabic ] = "/ "; + Text[ greek ] = " /"; + Text[ korean ] = "축 제목 표시/숨기기"; + Text[ turkish ] = "Eksen balklarn grntle/gizle"; + Text[ catalan ] = "Mostra/oculta ttol d'eixos"; + Text[ finnish ] = "Akseliotsikot kytss / poissa kytst"; + Text[ thai ] = "ชื่อแกน มี/ไม่มี"; + Text[ czech ] = "Titulky os zap/vyp"; + Text[ hebrew ] = "Achsentitel ein/aus"; + Text[ hindi ] = "अक्ष शीर्षकें शुरु/बंद"; + Text[ slovak ] = "Zapnúť/vypnúť názvy osí"; +}; +String STR_UNDO_TOGGLE_AXIS_DESCR +{ + Text = "Achsenbeschriftung ein/aus" ; + Text [ ENGLISH ] = "Axis Description on/off" ; + Text [ dutch ] = "Asbijschriften aan/uit" ; + Text [ english_us ] = "Axis labels on/off" ; + Text [ italian ] = "Mostra/nascondi dicitura assi" ; + Text [ spanish ] = "Mostrar/ocultar etiqueta de ejes" ; + Text [ french ] = "Afficher/masquer les tiquettes des axes" ; + Text [ swedish ] = "Axeletiketter p/av" ; + Text [ danish ] = "Akseetiketter til/fra" ; + Text [ portuguese ] = "Activar/Desactivar legenda dos eixos" ; + Text [ portuguese_brazilian ] = "Ativar/desativar rtulos do eixo" ; + Text[ chinese_simplified ] = "显示或隐入轴数据标志"; + Text[ russian ] = " "; + Text[ polish ] = "Wcz/wycz etykiety osi"; + Text[ japanese ] = "軸ラベル オン/オフ"; + Text[ chinese_traditional ] = "顯示/隱入軸數值標籤"; + Text[ arabic ] = "/ "; + Text[ greek ] = " /"; + Text[ korean ] = "축 레이블 표시/숨기기"; + Text[ turkish ] = "Eksen etiketlerini grntle/gizle"; + Text[ catalan ] = "Etiquetes de l'eix activades/desactivades"; + Text[ finnish ] = "Akseliselitteet kytss / poissa kytst"; + Text[ thai ] = "ป้ายชื่อแกน มี/ไม่มี"; + Text[ czech ] = "Popisy os zap/vyp"; + Text[ hebrew ] = "Achsenbeschriftung ein/aus"; + Text[ hindi ] = "अक्ष लेबिलें शुरु/बंद"; + Text[ slovak ] = "Zapnúť/vypnúť popisy osí"; +}; +String STR_UNDO_TOGGLE_GRID_HORZ +{ + Text = "Gitter horizontal ein/aus" ; + Text [ ENGLISH ] = "Grid horizontal on/off" ; + Text [ english_us ] = "Horizontal grid on/off" ; + Text [ italian ] = "Mostra/nascondi griglia orizzontale" ; + Text [ spanish ] = "Mostrar/ocultar cuadrcula horizontal" ; + Text [ french ] = "Afficher/masquer la grille horizontale " ; + Text [ dutch ] = "Horizontaal raster aan/uit" ; + Text [ swedish ] = "Horisontellt gitter p/av" ; + Text [ danish ] = "Vandret gitter til/fra" ; + Text [ portuguese ] = "Activar/Desactivar grelha horizontal" ; + Text [ portuguese_brazilian ] = "Ativar/desativar grade horizontal" ; + Text[ chinese_simplified ] = "显示或隐入横向网格线"; + Text[ russian ] = " "; + Text[ polish ] = "Wcz/Wycz siatk poziom"; + Text[ japanese ] = "目盛線(横) オン/オフ"; + Text[ chinese_traditional ] = "顯示/隱入橫向網格"; + Text[ arabic ] = "/ "; + Text[ greek ] = " /"; + Text[ korean ] = "가로 눈금선 표시/숨기기"; + Text[ turkish ] = "Yatay klavuz izgilerini grntle/gizle"; + Text[ catalan ] = "Graella horitzontal activada/desactivada"; + Text[ finnish ] = "Vaakaruudukko kytss / poissa kytst"; + Text[ thai ] = "เส้นตารางแนวนอน มี/ไม่มี"; + Text[ czech ] = "Vodorovná mřížka zap/vyp"; + Text[ hebrew ] = "Gitter horizontal ein/aus"; + Text[ hindi ] = "समतल जाल शुरु/बंद"; + Text[ slovak ] = "Zapnúť/vypnúť vodorovnú mriežku"; +}; +String STR_UNDO_TOGGLE_GRID_VERT +{ + Text = "Gitter vertikal ein/aus" ; + Text [ ENGLISH ] = "Grid vertical on/off" ; + Text [ english_us ] = "Vertical grid on/off" ; + Text [ italian ] = "Mostra/nascondi griglia verticale" ; + Text [ spanish ] = "Conmutar cuadrcula vertical" ; + Text [ french ] = "Afficher/masquer la grille verticale" ; + Text [ dutch ] = "Verticaal raster aan/uit" ; + Text [ swedish ] = "Vertikalt gitter p/av" ; + Text [ danish ] = "Lodret gitter til/fra" ; + Text [ portuguese ] = "Activar/Desactivar grelha vertical" ; + Text [ portuguese_brazilian ] = "Ativar/desativar grade vertical" ; + Text[ chinese_simplified ] = "显示或隐入纵向网格"; + Text[ russian ] = " "; + Text[ polish ] = "Wcz/Wycz siatk pionow"; + Text[ japanese ] = "目盛線(縦) オン/オフ"; + Text[ chinese_traditional ] = "顯示/隱入縱向網格"; + Text[ arabic ] = "/ "; + Text[ greek ] = " /"; + Text[ korean ] = "세로 눈금선 표시/숨기기"; + Text[ turkish ] = "Dikey klavuz izgilerini grntle/gizle"; + Text[ catalan ] = "Graella vertical activada/desactivada"; + Text[ finnish ] = "Pystyruudukko kytss / poissa kytst"; + Text[ thai ] = "เส้นตารางแนวตั้ง มี/ไม่มี"; + Text[ czech ] = "Svislá mřížka zap/vyp"; + Text[ hebrew ] = "Gitter vertikal ein/aus"; + Text[ hindi ] = "लंबरूप जाल शुरु/बंद"; + Text[ slovak ] = "Zapnúť/vypnúť zvislú mriežku"; +}; +String STR_UNDO_DATA_IN_ROWS +{ + Text = "Daten in Zeilen" ; + Text [ ENGLISH ] = "Data in Rows" ; + Text [ dutch ] = "Gegevens in rijen" ; + Text [ english_us ] = "Data in Rows" ; + Text [ italian ] = "Dati nelle righe" ; + Text [ spanish ] = "Datos en filas" ; + Text [ french ] = "Donnes en lignes" ; + Text [ swedish ] = "Data i rader" ; + Text [ danish ] = "Data i rkker" ; + Text [ portuguese ] = "Dados em linhas" ; + Text [ portuguese_brazilian ] = "Dados nas Linhas" ; + Text[ chinese_simplified ] = "数据插入行"; + Text[ russian ] = " "; + Text[ polish ] = "Dane w wierszach"; + Text[ japanese ] = "系列を行方向に定義"; + Text[ chinese_traditional ] = "資料插入欄"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "행 계열"; + Text[ turkish ] = "Satrlardaki veriler"; + Text[ catalan ] = "Dades en files"; + Text[ finnish ] = "Rivien tiedot"; + Text[ thai ] = "ข้อมูลในแถว"; + Text[ czech ] = "Data v řádcích"; + Text[ hebrew ] = "Daten in Zeilen"; + Text[ hindi ] = "Data in Rows"; + Text[ slovak ] = "Dáta v riadkoch"; +}; +String STR_UNDO_DATA_IN_COLUMNS +{ + Text = "Daten in Spalten" ; + Text [ ENGLISH ] = "Data in Columns" ; + Text [ dutch ] = "Gegevens in kolommen" ; + Text [ english_us ] = "Data in Columns" ; + Text [ italian ] = "Dati nelle colonne" ; + Text [ spanish ] = "Datos en columnas" ; + Text [ french ] = "Donnes en colonnes" ; + Text [ swedish ] = "Data i kolumner" ; + Text [ danish ] = "Data i kolonner" ; + Text [ portuguese ] = "Dados em colunas" ; + Text [ portuguese_brazilian ] = "Dados nas Colunas" ; + Text[ chinese_simplified ] = "列数据"; + Text[ russian ] = " "; + Text[ polish ] = "Dane w kolumnach"; + Text[ japanese ] = "系列を列方向に定義"; + Text[ chinese_traditional ] = "資料插入欄"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "열 계열"; + Text[ turkish ] = "Stunlardaki veriler"; + Text[ catalan ] = "Dades en columnes"; + Text[ finnish ] = "Sarakkeiden tiedot"; + Text[ thai ] = "ข้อมูลในคอลัมน์"; + Text[ czech ] = "Data ve sloupcích"; + Text[ hebrew ] = "Daten in Spalten"; + Text[ hindi ] = "Data in Columns"; + Text[ slovak ] = "Dáta v stĺpcoch"; +}; +String STR_DEFAULTVIEW +{ + Text = "Default" ; + Text [ ENGLISH ] = "Default" ; + Text [ norwegian ] = "Standard" ; + Text [ italian ] = "Predefinito" ; + Text [ portuguese_brazilian ] = "Padro" ; + Text [ portuguese ] = "Padro" ; + Text [ finnish ] = "Oletus" ; + Text [ danish ] = "Standard" ; + Text [ french ] = "Dfaut" ; + Text [ swedish ] = "Standard" ; + Text [ dutch ] = "Standaard" ; + Text [ spanish ] = "Predeterminado" ; + Text [ english_us ] = "Default" ; + Text[ chinese_simplified ] = "默认"; + Text[ russian ] = ""; + Text[ polish ] = "Domylnie"; + Text[ japanese ] = "標準"; + Text[ chinese_traditional ] = "默認"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "기본값"; + Text[ turkish ] = "Standart"; + Text[ catalan ] = "Per defecte"; + Text[ thai ] = "ค่าเริ่มต้น"; + Text[ czech ] = "Výchozí"; + Text[ hebrew ] = "ברירת מחדל"; + Text[ hindi ] = "अनुपस्थिति"; + Text[ slovak ] = "Východzie"; +}; + + +String STR_OPEN_DOCUMENT +{ + Text = "Dokument laden" ; + Text [ ENGLISH ] = "Open document" ; + Text [ norwegian ] = "Open document" ; + Text [ italian ] = "Apri documento" ; + Text [ portuguese_brazilian ] = "Carregar documento" ; + Text [ portuguese ] = "Carregar documento" ; + Text [ english_us ] = "Load document" ; + Text [ finnish ] = "Lataa asiakirja" ; + Text [ danish ] = "Indls dokument" ; + Text [ french ] = "Charger un document" ; + Text [ swedish ] = "Ladda dokument" ; + Text [ dutch ] = "Document laden" ; + Text [ spanish ] = "Cargar documento" ; + Text[ chinese_simplified ] = "装入文档"; + Text[ russian ] = " "; + Text[ polish ] = "aduj dokument"; + Text[ japanese ] = "ドキュメントを読み込む"; + Text[ chinese_traditional ] = "載入文件"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "문서 로드"; + Text[ turkish ] = "Belge ykle"; + Text[ catalan ] = "Carrega el document"; + Text[ thai ] = "โหลดเอกสาร"; + Text[ czech ] = "Načíst dokument"; + Text[ hebrew ] = "טעינת מסמך"; + Text[ hindi ] = "Load document"; + Text[ slovak ] = "Načítavam dokument"; +}; +String STR_SAVE_DOCUMENT +{ + Text[ italian ] = "Salva documento"; + Text[ portuguese_brazilian ] = "Salvar documento"; + Text[ portuguese ] = "Guardar documento"; + Text[ danish ] = "Gem dokument"; + Text[ french ] = "Enregistrer le document"; + Text[ swedish ] = "Spara dokument"; + Text[ dutch ] = "Document opslaan"; + Text[ spanish ] = "Guardar documento"; + Text[ english_us ] = "Save document"; + Text[ chinese_simplified ] = "存盘文档"; + Text[ russian ] = " "; + Text[ polish ] = "Zapisz dokument"; + Text[ japanese ] = "ドキュメントの保存"; + Text[ chinese_traditional ] = "儲存文件"; + Text[ arabic ] = " "; + Text = "Dokument speichern" ; + Text [ ENGLISH ] = "Save document" ; + Text [ norwegian ] = "Save document" ; + Text [ italian ] = "Salva documento" ; + Text [ portuguese_brazilian ] = "Salvar documento" ; + Text [ portuguese ] = "Guardar documento" ; + Text [ english_us ] = "Save document" ; + Text [ finnish ] = "Tallenna asiakirja" ; + Text [ danish ] = "Gem dokument" ; + Text [ french ] = "Enregistrer le document" ; + Text [ swedish ] = "Spara dokument" ; + Text [ dutch ] = "Document opslaan" ; + Text [ spanish ] = "Guardar documento" ; + Text = "Dokument speichern" ; + Text[ greek ] = " "; + Text[ korean ] = "문서 저장"; + Text[ turkish ] = "Belgeyi kaydet"; + Text[ catalan ] = "Desa el document"; + Text[ thai ] = "บันทึกเอกสาร"; + Text[ czech ] = "uložit dokument"; + Text[ hebrew ] = "Dokument speichern"; + Text[ hindi ] = "लेखपत्र संचित करो"; + Text[ slovak ] = "Ukladám dokument"; +}; +String STR_ACTION_NOTPOSSIBLE +{ + Text = "Die Funktion kann mit den selektierten \nObjekten nicht ausgefhrt werden." ; + Text [ ENGLISH ] = "Action could not completed with selected objects." ; + Text [ norwegian ] = "Action could not completed with selected objects." ; + Text [ italian ] = "La funzione non pu essere eseguita con l'oggetto scelto" ; + Text [ portuguese_brazilian ] = "Esta funo no pode ser completada com os objetos selecionados." ; + Text [ portuguese ] = "Esta funo no pode ser executada \n com os objectos seleccionados." ; + Text [ finnish ] = "Tt toimintoa ei voi kytt valittujen objektien kanssa." ; + Text [ danish ] = "Denne funktion kan ikke udfres \nmed de markerede objekter." ; + Text [ french ] = "La fonction ne peut tre excute avec les objets slectionns." ; + Text [ swedish ] = "Funktionen kan inte utfras med \nde markerade objekten" ; + Text [ dutch ] = "Deze functie kan met de gekozen\nobjecten niet worden voltooid." ; + Text [ spanish ] = "No es posible ejecutar la accin\ncon los objetos seleccionados." ; + Text [ english_us ] = "This function cannot be completed with the selected objects." ; + Text[ chinese_simplified ] = "无法执行选中对象的功能。"; + Text[ russian ] = " \n ."; + Text[ polish ] = "Funkcja nie moe zosta wykonana \nz zaznaczonymi obiektami."; + Text[ japanese ] = "この機能は選択したオブジェクトでは\n実行できません。"; + Text[ chinese_traditional ] = "無法執行選取物件的功能。"; + Text[ arabic ] = " \n ."; + Text[ greek ] = " \n ."; + Text[ korean ] = "이 기능은 선택된 \n개체와 함께 실행될 수 없습니다."; + Text[ turkish ] = "Bu fonksiyon, seilen nesneler ile \nyrtlemez.."; + Text[ catalan ] = "No es pot executar l'acci\namb els objectes seleccionats."; + Text[ thai ] = "ไม่สามารถทำให้ฟังก์ชั่นนี้สมบูรณ์ด้วยวัตถุที่เลือก"; + Text[ czech ] = "Tato funkce nemůže být dokončena s vybranými objekty."; + Text[ hebrew ] = "Die Funktion kann mit den selektierten \nObjekten nicht ausgeführt werden."; + Text[ hindi ] = "इस फंक्शन् को चुने हुये वस्तुओं के सहित समाप्त नहीं कर सकते है ।"; + Text[ slovak ] = "Táto funkcia nemôže byť dokončená s vybranými objektami."; +}; +String STR_GRAPHIC +{ + Text = "Chart" ; + Text [ ENGLISH ] = "Chart" ; + Text [ norwegian ] = "Chart" ; + Text [ italian ] = "Diagramma" ; + Text [ portuguese_brazilian ] = "Grfico" ; + Text [ portuguese ] = "Chart" ; + Text [ french ] = "Diagramme" ; + Text [ dutch ] = "Chart" ; + Text [ spanish ] = "Diagrama" ; + Text [ danish ] = "Diagram" ; + Text [ swedish ] = "Chart" ; + Text [ finnish ] = "Kaavio" ; + Text [ english_us ] = "Chart" ; + Text[ chinese_simplified ] = "图表"; + Text[ russian ] = ""; + Text[ polish ] = "Wykres"; + Text[ japanese ] = "グラフ"; + Text[ chinese_traditional ] = "圖表"; + Text[ arabic ] = " "; + Text[ greek ] = ""; + Text[ korean ] = "차트"; + Text[ turkish ] = "ema"; + Text[ catalan ] = "Diagrama"; + Text[ thai ] = "แผนภูมิ"; + Text[ czech ] = "Graf"; + Text[ hebrew ] = "תרשים"; + Text[ hindi ] = "चार्ट"; + Text[ slovak ] = "Graf"; +}; +String STR_CHART_DOCUMENT +{ + Text = "Diagramm" ; + Text [ ENGLISH ] = "Chart" ; + Text [ english_us ] = "Chart" ; + Text [ dutch ] = "Diagram" ; + Text [ swedish ] = "Diagram" ; + Text [ danish ] = "Diagram" ; + Text [ italian ] = "Diagramma" ; + Text [ spanish ] = "Diagrama" ; + Text [ french ] = "Diagramme" ; + Text [ portuguese ] = "Grfico" ; + Text [ portuguese_brazilian ] = "Grfico" ; + Text[ chinese_simplified ] = "图表"; + Text[ russian ] = ""; + Text[ polish ] = "Wykres"; + Text[ japanese ] = "グラフ"; + Text[ chinese_traditional ] = "圖表"; + Text[ arabic ] = " "; + Text[ greek ] = ""; + Text[ korean ] = "차트"; + Text[ turkish ] = "ema"; + Text[ catalan ] = "Diagrama"; + Text[ finnish ] = "Kaavio"; + Text[ thai ] = "แผนภูมิ"; + Text[ czech ] = "Graf"; + Text[ hebrew ] = "תרשים"; + Text[ hindi ] = "चार्ट"; + Text[ slovak ] = "Graf"; +}; +String STR_CHART_DOCUMENT_FULLTYPE_60 +{ + Text = "%PRODUCTNAME %PRODUCTVERSION Diagramm" ; + Text [ ENGLISH ] = "StarOffice 6.0 Chart" ; + Text [ english_us ] = "%PRODUCTNAME %PRODUCTVERSION Chart" ; + Text [ dutch ] = "%PRODUCTNAME 6.0 Diagram" ; + Text [ swedish ] = "%PRODUCTNAME 6.0 Diagram" ; + Text [ danish ] = "%PRODUCTNAME 6.0-diagram" ; + Text [ italian ] = "%PRODUCTNAME 6.0 Diagramma" ; + Text [ spanish ] = "%PRODUCTNAME 6.0 Diagrama" ; + Text [ french ] = "%PRODUCTNAME 6.0 Diagramme" ; + Text [ portuguese ] = "%PRODUCTNAME 6.0 Grfico" ; + Text [ portuguese_brazilian ] = "%PRODUCTNAME 6.0 Chart" ; + Text[ chinese_simplified ] = "%PRODUCTNAME 6.0 图表"; + Text[ russian ] = " %PRODUCTNAME 6.0"; + Text[ polish ] = "%PRODUCTNAME 6.0 Chart"; + Text[ japanese ] = "%PRODUCTNAME 6.0 グラフ"; + Text[ chinese_traditional ] = "%PRODUCTNAME 6.0 圖表"; + Text[ arabic ] = " %PRODUCTNAME 6.0"; + Text[ greek ] = "%PRODUCTNAME 6.0 "; + Text[ korean ] = "%PRODUCTNAME 6.0 차트"; + Text[ turkish ] = "%PRODUCTNAME 6.0 izelgesi"; + Text[ catalan ] = "%PRODUCTNAME 6.0 Diagrama"; + Text[ finnish ] = "%PRODUCTNAME 6.0 Chart"; + Text[ thai ] = "แผนภูมิ%PRODUCTNAME 6.0 "; + Text[ czech ] = "%PRODUCTNAME 6.0 Graf"; + Text[ hebrew ] = "%PRODUCTNAME 6.0 Diagramm"; + Text[ hindi ] = "%PRODUCTNAME 6.0 चार्ट"; + Text[ slovak ] = "%PRODUCTNAME 6.0 Graf"; +}; +String STR_CHART_DOCUMENT_FULLTYPE_50 +{ + Text = "%PRODUCTNAME 5.0 Diagramm" ; + Text [ ENGLISH ] = "StarOffice 5.0 Chart" ; + Text [ english_us ] = "%PRODUCTNAME 5.0 Chart" ; + Text [ dutch ] = "%PRODUCTNAME 5.0 diagram" ; + Text [ swedish ] = "%PRODUCTNAME 5.0 Diagram" ; + Text [ danish ] = "%PRODUCTNAME 5.0 diagram" ; + Text [ italian ] = "Diagramma %PRODUCTNAME 5.0" ; + Text [ spanish ] = "%PRODUCTNAME 5.0 Diagrama" ; + Text [ french ] = "%PRODUCTNAME 5.0 Diagramme" ; + Text [ portuguese ] = "Grfico (%PRODUCTNAME 5.0)" ; + Text [ portuguese_brazilian ] = "%PRODUCTNAME 5.0 Chart" ; + Text[ chinese_simplified ] = "%PRODUCTNAME 5.0 图表"; + Text[ russian ] = " %PRODUCTNAME 5.0"; + Text[ polish ] = "%PRODUCTNAME 5.0 Chart"; + Text[ japanese ] = "%PRODUCTNAME 5.0 グラフ"; + Text[ chinese_traditional ] = "%PRODUCTNAME 5.0 圖表"; + Text[ arabic ] = " %PRODUCTNAME 5.0"; + Text[ greek ] = " (%PRODUCTNAME 5.0)"; + Text[ korean ] = "%PRODUCTNAME 5.0 차트"; + Text[ turkish ] = "%PRODUCTNAME 5.0 emas"; + Text[ catalan ] = "%PRODUCTNAME 5.0 Diagrama"; + Text[ finnish ] = "%PRODUCTNAME 5.0 Chart"; + Text[ thai ] = "แผนภูมิ%PRODUCTNAME 5.0 "; + Text[ czech ] = "%PRODUCTNAME 5.0 Graf"; + Text[ hebrew ] = "%PRODUCTNAME 5.0 Diagramm"; + Text[ hindi ] = "%PRODUCTNAME 5.0 चार्ट"; + Text[ slovak ] = "%PRODUCTNAME 5.0 Graf"; +}; +String STR_CHART_DOCUMENT_FULLTYPE_40 +{ + Text = "%PRODUCTNAME 4.0 Diagramm" ; + Text [ ENGLISH ] = "StarOffice 4.0 Chart" ; + Text [ english_us ] = "%PRODUCTNAME 4.0 Chart" ; + Text [ dutch ] = "%PRODUCTNAME 4.0 diagram" ; + Text [ swedish ] = "%PRODUCTNAME 4.0 Diagram" ; + Text [ danish ] = "%PRODUCTNAME 4.0 diagram" ; + Text [ italian ] = "Diagramma %PRODUCTNAME 4.0" ; + Text [ spanish ] = "%PRODUCTNAME 4.0 Diagrama" ; + Text [ french ] = "%PRODUCTNAME 4.0 Diagramme" ; + Text [ portuguese ] = "Grfico (%PRODUCTNAME 4.0)" ; + Text [ portuguese_brazilian ] = "%PRODUCTNAME 4.0 Chart" ; + Text[ chinese_simplified ] = "%PRODUCTNAME 4.0 图表"; + Text[ russian ] = " %PRODUCTNAME 4.0"; + Text[ polish ] = "%PRODUCTNAME 4.0 Chart"; + Text[ japanese ] = "%PRODUCTNAME 4.0 グラフ"; + Text[ chinese_traditional ] = "%PRODUCTNAME 4.0 圖表"; + Text[ arabic ] = " %PRODUCTNAME 4.0"; + Text[ greek ] = " (%PRODUCTNAME 4.0)"; + Text[ korean ] = "%PRODUCTNAME 4.0 차트"; + Text[ turkish ] = "%PRODUCTNAME 4.0 emas"; + Text[ catalan ] = "%PRODUCTNAME 4.0 Diagrama"; + Text[ finnish ] = "%PRODUCTNAME 4.0 Chart"; + Text[ thai ] = "แผนภูมิ%PRODUCTNAME 4.0 "; + Text[ czech ] = "%PRODUCTNAME 4.0 Graf"; + Text[ hebrew ] = "%PRODUCTNAME 4.0 Diagramm"; + Text[ hindi ] = "%PRODUCTNAME 4.0 चार्ट"; + Text[ slovak ] = "%PRODUCTNAME 4.0 Graf"; +}; +String STR_CHART_DOCUMENT_FULLTYPE_31 +{ + Text = "%PRODUCTNAME 3.0 Diagramm" ; + Text [ ENGLISH ] = "StarOffice 3.0 Chart" ; + Text [ english_us ] = "%PRODUCTNAME 3.0 Chart" ; + Text [ dutch ] = "%PRODUCTNAME 3.0 diagram" ; + Text [ swedish ] = "%PRODUCTNAME 3.0 Diagram" ; + Text [ danish ] = "%PRODUCTNAME 3.0 diagram" ; + Text [ italian ] = "Diagramma %PRODUCTNAME 3.0" ; + Text [ spanish ] = "%PRODUCTNAME 3.0 Diagrama" ; + Text [ french ] = "%PRODUCTNAME 3.0 Diagramme" ; + Text [ portuguese ] = "Grfico (%PRODUCTNAME 3.0)" ; + Text [ portuguese_brazilian ] = "%PRODUCTNAME 3.0 Chart" ; + Text[ chinese_simplified ] = "%PRODUCTNAME 3.0 图表"; + Text[ russian ] = " %PRODUCTNAME 3.0"; + Text[ polish ] = "%PRODUCTNAME 3.0 Chart"; + Text[ japanese ] = "%PRODUCTNAME 3.0 グラフ"; + Text[ chinese_traditional ] = "%PRODUCTNAME 3.0 圖表"; + Text[ arabic ] = " %PRODUCTNAME 3.0"; + Text[ greek ] = " (%PRODUCTNAME 3.0)"; + Text[ korean ] = "%PRODUCTNAME 3.0 차트"; + Text[ turkish ] = "%PRODUCTNAME 3.0 emas"; + Text[ catalan ] = "%PRODUCTNAME 3.0 Diagrama"; + Text[ finnish ] = "%PRODUCTNAME 3.0 Chart"; + Text[ thai ] = "แผนภูมิ%PRODUCTNAME 3.0 "; + Text[ czech ] = "%PRODUCTNAME 3.0 Graf"; + Text[ hebrew ] = "%PRODUCTNAME 3.0 Diagramm"; + Text[ hindi ] = "%PRODUCTNAME 3.0 चार्ट"; + Text[ slovak ] = "%PRODUCTNAME 3.0 Graf"; +}; +String STR_BAD_PASSWORD_OR_FILE_CORRUPTED +{ + Text = "Das Kennwort ist falsch oder die Datei beschdigt." ; + Text [ ENGLISH ] = "The password is wrong or the file is corrupted." ; + Text [ norwegian ] = "The password is wrong or the file is corrupted." ; + Text [ italian ] = "La password errata o il file danneggiato." ; + Text [ portuguese_brazilian ] = "A senha invalida ou o arquivo est corrompido." ; + Text [ portuguese ] = "Ou a senha est incorrecta ou o ficheiro danificado." ; + Text [ french ] = "Le mot de passe est incorrect ou le fichier est dfectueux." ; + Text [ dutch ] = "Het wachtwoord is niet juist of het bestand is beschadigd" ; + Text [ spanish ] = "La contrasea no es vlida o el archivo est daado." ; + Text [ danish ] = "Adgangskoden er forkert eller filen er beskadiget." ; + Text [ swedish ] = "Lsenordet r felaktigt eller filen skadad." ; + Text [ finnish ] = "Salasana on virheellinen tai tiedosto on vahingoittunut." ; + Text [ english_us ] = "The password is incorrect or the file is damaged." ; + Text[ chinese_simplified ] = "无效的密码或文件已经被损坏。"; + Text[ russian ] = " ."; + Text[ polish ] = "Nieprawidowe haso lub uszkodzony plik."; + Text[ japanese ] = "パスワードが間違っているか、またはファイルに問題があります。"; + Text[ chinese_traditional ] = "無效的密碼或檔案已經被損壞。"; + Text[ arabic ] = " ."; + Text[ greek ] = " ."; + Text[ korean ] = "암호가 틀리거나 파일이 손상되었습니다."; + Text[ turkish ] = "ifre yanl veya dosya zarar grm."; + Text[ catalan ] = "La contrasenya no s correcta o el fitxer est danyat."; + Text[ thai ] = "รหัสผ่านไม่ถูกต้องหรือแฟ้มเสียหาย"; + Text[ czech ] = "Heslo je neplatné nebo soubor je poškozen."; + Text[ hebrew ] = "Das Kennwort ist falsch oder die Datei beschädigt."; + Text[ hindi ] = "The password is incorrect or the file is damaged."; + Text[ slovak ] = "Heslo je nesprávne alebo je poškodený súbor."; +}; +String RID_PLUGINTOOLBOX +{ + Text = "PlugInleiste" ; + Text [ ENGLISH ] = "Plugin toolbox" ; + Text [ english_us ] = "Plug-in Bar" ; + Text [ italian ] = "Barra degli oggetti per i PlugIn" ; + Text [ spanish ] = "Barra de Plug-ins" ; + Text [ french ] = "Barre de Plug-ins" ; + Text [ dutch ] = "PlugIn-balk" ; + Text [ swedish ] = "Funktionslist fr plug-ins" ; + Text [ danish ] = "PlugInlinje" ; + Text [ portuguese_brazilian ] = "Barra de Plugins" ; + Text [ portuguese ] = "Barra de Plugins" ; + Text[ chinese_simplified ] = "Plug-In 栏"; + Text[ russian ] = " "; + Text[ polish ] = "Pasek wtyczek plug-in"; + Text[ japanese ] = "プラグインバー"; + Text[ chinese_traditional ] = "Plug-In 列"; + Text[ arabic ] = " Plug-In"; + Text[ greek ] = " "; + Text[ korean ] = "플러그인 모음"; + Text[ turkish ] = "Plug-In ubuu"; + Text[ catalan ] = "Barra de connectors"; + Text[ finnish ] = "Lisosapalkki"; + Text[ thai ] = "แถบปลั๊กอิน"; + Text[ czech ] = "Panel zásuvných modulů"; + Text[ hebrew ] = "PlugInleiste"; + Text[ hindi ] = "प्लग-इन् पट्टी"; + Text[ slovak ] = "Panel zásuvných modulov"; +}; + + +String STR_SURFACE +{ + Text = "Oberflchen" ; + Text [ ENGLISH ] = "Surface" ; + Text [ english_us ] = "Surfaces" ; + Text [ italian ] = "Superfici" ; + Text [ spanish ] = "Superficies" ; + Text [ french ] = "Superficies" ; + Text [ dutch ] = "Vlakken" ; + Text [ swedish ] = "Ytor" ; + Text [ danish ] = "Overflader" ; + Text [ portuguese ] = "Superfcies" ; + Text [ portuguese_brazilian ] = "Superfcies" ; + Text[ chinese_simplified ] = "平面"; + Text[ russian ] = ""; + Text[ polish ] = "Powierzchnie"; + Text[ japanese ] = "表面"; + Text[ chinese_traditional ] = "平面"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "표면"; + Text[ turkish ] = "Yzey"; + Text[ catalan ] = "Superficies"; + Text[ finnish ] = "Pinnat"; + Text[ thai ] = "พื้นผิว"; + Text[ czech ] = "Povrchy"; + Text[ hebrew ] = "Oberflächen"; + Text[ hindi ] = "सतह"; + Text[ slovak ] = "Povrchy"; +}; + + +String STR_STATISTICS_IN_LEGEND +{ + // comment + Text[ language_user1 ] = "BM: This determines how a statistics string (STR_REGRESSION_...) appears in the legend, e.g. in german \"Lineare Regression, Spalte 3\" will appear for \"$(STATTYP), $(ROWNAME)\""; + // comment + Text = "$(STATTYP), $(ROWNAME)"; + Text [ ENGLISH ] = "$(STATTYP), $(ROWNAME)" ; + Text [ english_us ] = "$(STATTYP), $(ROWNAME) " ; + Text [ italian ] = "$(STATTYP), $(ROWNAME)" ; + Text [ spanish ] = "$(STATTYP), $(ROWNAME)" ; + Text [ french ] = "$(STATTYP), $(ROWNAME)" ; + Text [ dutch ] = "$(STATTYP), $(ROWNAME)" ; + Text [ swedish ] = "$(STATTYP), $(ROWNAME)" ; + Text [ danish ] = "$(STATTYP), $(ROWNAME)" ; + Text [ portuguese ] = "$(STATTYP), $(ROWNAME)" ; + Text [ portuguese_brazilian ] = "$(STATTYP), $(ROWNAME)" ; + Text[ chinese_simplified ] = "$(STATTYP), $(ROWNAME)"; + Text[ russian ] = "$(STATTYP), $(ROWNAME)"; + Text[ polish ] = "$(STATTYP), $(ROWNAME)"; + Text[ japanese ] = "$(STATTYP)、$(ROWNAME)"; + Text[ chinese_traditional ] = "$(STATTYP), $(ROWNAME)"; + Text[ arabic ] = "$(STATTYP), $(ROWNAME)"; + Text[ greek ] = "$(STATTYP), $(ROWNAME)"; + Text[ korean ] = "$(STATTYP), $(ROWNAME)"; + Text[ turkish ] = "$(STATTYP), $(ROWNAME)"; + Text[ catalan ] = "$(STATTYP), $(ROWNAME) "; + Text[ finnish ] = "$(STATTYP), $(ROWNAME) "; + Text[ thai ] = "$(STATTYP), $(ROWNAME) "; + Text[ czech ] = "$(STATTYP), $(ROWNAME) "; + Text[ hebrew ] = "$(STATTYP), $(ROWNAME) "; + Text[ hindi ] = "$(STATTYP), $(ROWNAME) "; + Text[ slovak ] = "$(STATTYP), $(ROWNAME) "; +}; + +String STR_UNDO_SCALE +{ + Text = "Texte skalieren" ; + Text [ ENGLISH ] = "Scale Text" ; + Text [ english_us ] = "Scale Text" ; + Text [ italian ] = "Scala testi" ; + Text [ spanish ] = "Redimensionar texto" ; + Text [ french ] = "Redimensionner les textes" ; + Text [ dutch ] = "Teksten op schaal brengen" ; + Text [ swedish ] = "Skala texter" ; + Text [ danish ] = "Skaler tekst" ; + Text [ portuguese ] = "Redimensionar textos" ; + Text [ portuguese_brazilian ] = "Escalonar o Texto" ; + Text[ chinese_simplified ] = "采用文字显示比例"; + Text[ russian ] = " "; + Text[ polish ] = "Skaluj tekst"; + Text[ japanese ] = "テキストのスケール"; + Text[ chinese_traditional ] = "使用文字顯示比例"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "텍스트 배율 조정"; + Text[ turkish ] = "Metin leklendir"; + Text[ catalan ] = "Redimensiona el text"; + Text[ finnish ] = "Skaalaa teksti"; + Text[ thai ] = "สเกลข้อความ"; + Text[ czech ] = "Škálovat text"; + Text[ hebrew ] = "Texte skalieren"; + Text[ hindi ] = "स्केल् टेक्स्ट"; + Text[ slovak ] = "Upraviť mierku textu"; +}; +String STR_QUERY_SORT +{ + Text = "Die Werte fr die X-Achse mssen sortiert vorliegen\nMit Sortierung fortfahren ?" ; + Text [ ENGLISH ] = "Values on X-axis should be sorted.\nContinue sorted ?" ; + Text [ dutch ] = "De waarden voor de X-as moeten gesorteerd zijn.\nSorteren?" ; + Text [ english_us ] = "X axis values must be sorted.\nSort them now?" ; + Text [ italian ] = "I valori dell'asse X devono essere ordinati.\nIniziare ad ordinare ?" ; + Text [ spanish ] = "Los valores del eje x tienen que ser organizados.\nDesea continuar con la organizacin?" ; + Text [ french ] = "Les valeurs pour l'axe X doivent tre tries. \nPoursuivre le tri ?" ; + Text [ swedish ] = "Vrdena fr X-axeln mste vara sorterade.\nVill du fortstta att sortera?" ; + Text [ danish ] = "X-aksens vrdier skal vre sorteret\nVil du sortere dem nu?" ; + Text [ portuguese ] = "Os valores para o eixo X tm de estar ordenados\n Comear a ordenar?" ; + Text [ portuguese_brazilian ] = "Os valores para o eixo X devem ser ordenados\n Orden-los agora?" ; + Text[ chinese_simplified ] = "X 轴数值必须是排序好的。\n要现在排序?"; + Text[ russian ] = " X \n?"; + Text[ polish ] = "Wartoci na osi X musz zosta posortowane.\nCzy zrobi to teraz?"; + Text[ japanese ] = "X軸の数値を並べ替える必要があります\n並べ替えますか?"; + Text[ chinese_traditional ] = "X-軸必須是排序好的。\n現在要排序?"; + Text[ arabic ] = " .\n "; + Text[ greek ] = " X .\n ;"; + Text[ korean ] = "X 축 값을 정렬해야 합니다.\n지금 정렬하시겠습니까?"; + Text[ turkish ] = "X ekseni deerleri sralanm olmaldr\nSralamaya devam edilsin mi ?"; + Text[ catalan ] = "Els valors de l'eix X s'han d'ordenar.\\Voleu ordenar-los ara?"; + Text[ finnish ] = "X-akselin arvot on lajiteltava.\nLajitellaanko nyt?"; + Text[ thai ] = "เรียงค่าแกนX \nเรียงเดี๋ยวนี้หรือไม่?"; + Text[ czech ] = "Hodnoty osy X musí být seřazeny.\nSeřadit nyní?"; + Text[ hebrew ] = "Die Werte für die X-Achse müssen sortiert vorliegen\nMit Sortierung fortfahren ?"; + Text[ hindi ] = "X अक्ष के मूल्यों को सोर्ट करना चाहिए ।\nअभी सोर्ट करना चाहते है?"; + Text[ slovak ] = "Hodnoty na osi X musia byť zoradené.\nZoradiť ich teraz?"; +}; +String STR_UNDO_REMOVEPOINTATTRS +{ + Text = "Datenpunkt-Attribute entfernen" ; + Text [ ENGLISH ] = "Remove data point attributes" ; + Text [ english_us ] = "Remove data point attributes" ; + Text [ italian ] = "Elimina attributi del punto dati" ; + Text [ spanish ] = "Borrar atributos del punto de datos" ; + Text [ french ] = "Supprimer des attributs de point de donnes" ; + Text [ dutch ] = "Gegevenspunt-attributen verwijderen" ; + Text [ swedish ] = "Ta bort datapunktattribut" ; + Text [ danish ] = "Fjern datapunktattributter" ; + Text [ portuguese ] = "Remover atributos do ponto de dados" ; + Text [ portuguese_brazilian ] = "Remover atributos do ponto de dados" ; + Text[ chinese_simplified ] = "删除数据点属性"; + Text[ russian ] = " "; + Text[ polish ] = "Usu atrybuty punktu danych"; + Text[ japanese ] = "データポイントの属性を解除"; + Text[ chinese_traditional ] = "刪除資料點屬性"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "데이터 포인터 속성 제거"; + Text[ turkish ] = "Veri noktas zniteliklerini kaldr"; + Text[ catalan ] = "Suprimeix els atributs del punt de dades"; + Text[ finnish ] = "Poista arvopisteiden mritteet"; + Text[ thai ] = "เอาคุณลักษณะจุดข้อมูลออก"; + Text[ czech ] = "Odstranit atributy datového bodu"; + Text[ hebrew ] = "Datenpunkt-Attribute entfernen"; + Text[ hindi ] = "ड़ॉटा बिन्दुओं के ऍट्रिब्यूटों को हटाओ"; + Text[ slovak ] = "Odstrániť atribúty dátového bodu"; +}; +String STR_APPNAME +{ + Text = "StarChart" ; + Text [ ENGLISH ] = "StarChart" ; + Text [ english_us ] = "%PRODUCTNAME Chart" ; + Text [ dutch ] = "%PRODUCTNAME Chart" ; + Text [ swedish ] = "%PRODUCTNAME Chart" ; + Text [ danish ] = "%PRODUCTNAME Chart" ; + Text [ italian ] = "%PRODUCTNAME Chart" ; + Text [ spanish ] = "%PRODUCTNAME Chart" ; + Text [ french ] = "%PRODUCTNAME Chart" ; + Text [ portuguese ] = "%PRODUCTNAME Chart" ; + Text [ portuguese_brazilian ] = "%PRODUCTNAME Chart" ; + Text[ chinese_simplified ] = "%PRODUCTNAME Chart"; + Text[ russian ] = " %PRODUCTNAME"; + Text[ polish ] = "%PRODUCTNAME Chart"; + Text[ japanese ] = "%PRODUCTNAME Chart"; + Text[ chinese_traditional ] = "%PRODUCTNAME Chart"; + Text[ arabic ] = "%PRODUCTNAME Chart"; + Text[ greek ] = "StarChart"; + Text[ korean ] = "StarChart"; + Text[ turkish ] = "%PRODUCTNAME Chart"; + Text[ catalan ] = "%PRODUCTNAME Chart"; + Text[ finnish ] = "%PRODUCTNAME Chart"; + Text[ thai ] = "แผนภูมิ%PRODUCTNAME "; + Text[ czech ] = "%PRODUCTNAME Graf"; + Text[ hebrew ] = "StarChart"; + Text[ hindi ] = "%PRODUCTNAME चार्ट"; + Text[ slovak ] = "%PRODUCTNAME Graf"; +}; + +String STR_UNDO_MOREBACK +{ + Text = "Datenreihe verschieben" ; + Text [ ENGLISH ] = "Move Datarow" ; + Text[ italian ] = "Sposta serie di dati"; + Text[ portuguese_brazilian ] = "Mover srie de dados"; + Text[ portuguese ] = "Mover srie de dados"; + Text[ danish ] = "Flyt dataserie"; + Text[ french ] = "Dplacer la srie de donnes"; + Text[ swedish ] = "Flytta dataserie"; + Text[ dutch ] = "Gegevensreeks verplaatsen"; + Text[ spanish ] = "Desplazar fila de datos"; + Text[ english_us ] = "Move data series"; + Text[ chinese_simplified ] = "移动数据组"; + Text[ russian ] = " "; + Text[ polish ] = "Przenie seri danych"; + Text[ japanese ] = "データ系列の移動"; + Text[ chinese_traditional ] = "移動資料欄"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "연속 데이터 이동"; + Text[ turkish ] = "Veri dizisi ta"; + Text[ catalan ] = "Mou la fila de dades"; + Text[ finnish ] = "Siirr tietojoukot"; + Text[ thai ] = "ย้ายชุดข้อมูล"; + Text[ czech ] = "Přesunout datovou řadu"; + Text[ hebrew ] = "Datenreihe verschieben"; + Text[ hindi ] = "डॉटा श्रृंखला का स्थानांतर करो"; + Text[ slovak ] = "Presunúť dátové rady"; +}; +String STR_UNDO_MOREFRONT +{ + Text = "Datenreihe verschieben" ; + Text [ ENGLISH ] = "Move Datarow" ; + Text[ italian ] = "Sposta serie di dati"; + Text[ portuguese_brazilian ] = "Mover srie de dados"; + Text[ portuguese ] = "Mover srie de dados"; + Text[ danish ] = "Flyt dataserie"; + Text[ french ] = "Dplacer la srie de donnes"; + Text[ swedish ] = "Flytta dataserie"; + Text[ dutch ] = "Gegevensreeks verplaatsen"; + Text[ spanish ] = "Desplazar fila de datos"; + Text[ english_us ] = "Move data series"; + Text[ chinese_simplified ] = "移动数据组"; + Text[ russian ] = " "; + Text[ polish ] = "Przenie seri danych"; + Text[ japanese ] = "データ系列の移動"; + Text[ chinese_traditional ] = "移動資料欄"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "연속 데이터 이동"; + Text[ turkish ] = "Veri dizisi ta"; + Text[ catalan ] = "Mou la fila de dades"; + Text[ finnish ] = "Siirr tietojoukot"; + Text[ thai ] = "ย้ายชุดข้อมูล"; + Text[ czech ] = "Přesunout datovou řadu"; + Text[ hebrew ] = "Datenreihe verschieben"; + Text[ hindi ] = "डॉटा श्रृंखला का स्थानांतर करो"; + Text[ slovak ] = "Presunúť dátové rady"; +}; + +String STR_UNDO_DIAGRAM_STOCK_LOSS +{ + Text = "Negative Abweichung bearbeiten" ; + Text [ ENGLISH ] = "Modify negative deviation"; + Text[ italian ] = "Modifica deviazione negativa"; + Text[ portuguese_brazilian ] = "Editar desvio negativo"; + Text[ portuguese ] = "Modificar desvio negativo"; + Text[ danish ] = "Rediger negativ afvigelse"; + Text[ french ] = "diter la dviation ngative"; + Text[ swedish ] = "Redigera negativ avvikelse"; + Text[ dutch ] = "Negatieve deviatie bewerken"; + Text[ spanish ] = "Modificar desviacin negativa"; + Text[ english_us ] = "Edit negative deviation"; + Text[ chinese_simplified ] = "编辑负值偏差"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj odchylenie ujemne"; + Text[ japanese ] = "マイナス偏差の編集"; + Text[ chinese_traditional ] = "編輯負值偏差"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "음수 편차 편집"; + Text[ turkish ] = "Negatif sapmay dzenle"; + Text[ catalan ] = "Modifica la desviaci negativa"; + Text[ finnish ] = "Muokkaa negatiivista poikkeamaa"; + Text[ thai ] = "แก้ไขการเบี่ยงเบนลบ"; + Text[ czech ] = "Upravit negativní odchylku"; + Text[ hebrew ] = "Negative Abweichung bearbeiten"; + Text[ hindi ] = "क्षयराशि अतिक्रम संपादन"; + Text[ slovak ] = "Upraviť zápornú odchýlku"; +}; +String STR_UNDO_DIAGRAM_STOCK_PLUS +{ + Text = "positive Abweichung bearbeiten" ; + Text [ ENGLISH ] = "Modify positive deviation"; + Text[ italian ] = "Modifica deviazione positiva"; + Text[ portuguese_brazilian ] = "Editar desvio positivo"; + Text[ portuguese ] = "Modificar desvio positivo"; + Text[ danish ] = "Rediger positiv afvigelse"; + Text[ french ] = "diter la dviation positive"; + Text[ swedish ] = "Redigera positiv avvikelse"; + Text[ dutch ] = "Positieve deviatie bewerken"; + Text[ spanish ] = "Editar la desviacin positiva"; + Text[ english_us ] = "Edit positive deviation"; + Text[ chinese_simplified ] = "编辑正值偏差"; + Text[ russian ] = " "; + Text[ polish ] = "Edytuj odchylenie dodatnie"; + Text[ japanese ] = "プラス偏差の編集"; + Text[ chinese_traditional ] = "編輯正值偏差"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "양수 편차 편집"; + Text[ turkish ] = "Pozitif sapmay dzenle"; + Text[ catalan ] = "Modifica la desviaci positiva"; + Text[ finnish ] = "Muokkaa positiivista poikkeamaa"; + Text[ thai ] = "แก้ไขการเบี่ยงเบนบวก"; + Text[ czech ] = "Upravit pozitivní odchylku"; + Text[ hebrew ] = "positive Abweichung bearbeiten"; + Text[ hindi ] = "धनराशि अतिक्रम संपादन"; + Text[ slovak ] = "Upraviť kladnú odchýlku"; +}; +//----------------------------------- + + +String STR_UNDO_INSERT_SPECCHAR +{ + Text = "Sonderzeichen einfgen" ; + Text [ ENGLISH ] = "Insert special character" ; + Text [ english_us ] = "Insert special character" ; + Text [ italian ] = "Inserisci carattere speciale" ; + Text [ spanish ] = "Insertar smbolo" ; + Text [ french ] = "Insrer des caractres spciaux" ; + Text [ dutch ] = "Speciale tekens invoegen" ; + Text [ swedish ] = "Infoga specialtecken" ; + Text [ danish ] = "Indst specialtegn" ; + Text [ portuguese ] = "Inserir caracteres especiais" ; + Text [ portuguese_brazilian ] = "Inserir caracter especial" ; + Text[ chinese_simplified ] = "插入特殊字符"; + Text[ russian ] = " "; + Text[ polish ] = "Wstaw znak specjalny"; + Text[ japanese ] = "特殊文字の挿入"; + Text[ greek ] = " "; + Text[ korean ] = "특수 문자 삽입"; + Text[ chinese_traditional ] = "插入特殊字元"; + Text[ arabic ] = " "; + Text[ turkish ] = "zel karakter ekle"; + Text[ catalan ] = "Insereix smbol"; + Text[ finnish ] = "Lis erikoismerkki"; + Text[ thai ] = "แทรกตัวอักขระพิเศษ"; + Text[ czech ] = "Vložit zvláštní znak"; + Text[ hebrew ] = "Sonderzeichen einfügen"; + Text[ hindi ] = "विशेष अक्षर को जोड़ो"; + Text[ slovak ] = "Vložiť špeciálny znak"; +}; + +// some strings merged using arguments now + +String STR_STATUS_DATAPOINT_MARKED +{ + // this string is displayed in the status bar whenever a data point is selected + + Text = "Datenpunkt $(PT_NUM) in Reihe $(ROW_NUM) markiert, Wert: $(VALUE)"; + Text [ english_us ] = "Data Point $(PT_NUM) in row $(ROW_NUM) selected, value: $(VALUE)"; + Text[ portuguese ] = "Ponto de dados $(PT_NUM) na srie $(ROW_NUM) seleccionado, valor: $(VALUE)"; + Text[ russian ] = " $(PT_NUM) $(ROW_NUM) , : $(VALUE)"; + Text[ greek ] = " $(PT_NUM) $(ROW_NUM), : $(VALUE)"; + Text[ dutch ] = "Gegevenspunt $(PT_NUM) in rij $(ROW_NUM) gemarkeerd, waarde: $(VALUE)"; + Text[ french ] = "Point de donnes $(PT_NUM) dans la srie $(ROW_NUM) marqu, valeur : $(VALUE)"; + Text[ spanish ] = "Punto de datos $(PT_NUM) en fila $(ROW_NUM) seleccionado, valor: $(VALUE)"; + Text[ italian ] = "Punto dati $(PT_NUM) in serie $(ROW_NUM) selezionato, valore: $(VALUE)"; + Text[ danish ] = "Datapunkt $(PT_NUM) i serie $(ROW_NUM) markeret, vrdi: $(VALUE)"; + Text[ swedish ] = "Datapunkt $(PT_NUM) i serie $(ROW_NUM) markerad, vrde: $(VALUE)"; + Text[ polish ] = "Zaznaczono punkt danych $(PT_NUM) w wierszu $(ROW_NUM), warto: $(VALUE)"; + Text[ portuguese_brazilian ] = "Ponto de dados $(PT_NUM) na linha $(ROW_NUM) selecionado, valor: $(VALUE)"; + Text[ japanese ] = "系列$(ROW_NUM)のデータ ポイント$(PT_NUM)を選択、数値: $(VALUE)"; + Text[ korean ] = "열 $(ROW_NUM)의 데이터 포인트 $(PT_NUM) 표시됨, 값:$(VALUE)"; + Text[ chinese_simplified ] = "选中数据系列$(ROW_NUM)中的数据点$(PT_NUM),数值:$(VALUE)"; + Text[ chinese_traditional ] = "選取 $(ROW_NUM)欄的資料點 $(PT_NUM),數值:$(VALUE)"; + Text[ arabic ] = " $(PT_NUM) $(ROW_NUM) ɡ : $(VALUE)"; + Text[ turkish ] = "$(ROW_NUM) dizisindeki $(PT_NUM) veri noktas iaretlendi. Deeri: $(VALUE)"; + Text[ catalan ] = "S'ha seleccionat el punt de dades $(PT_NUM) de la fila $(ROW_NUM), valor: $(VALUE)"; + Text[ finnish ] = "Valittu arvopiste $(PT_NUM) rivilt $(ROW_NUM), arvo: $(VALUE)"; + Text[ thai ] = "เลือกจุดข้อมูล $(PT_NUM) ในแถว $(ROW_NUM) , ค่า: $(VALUE)"; + Text[ czech ] = "Byl zvolen datový bod $(PT_NUM) na řádku $(ROW_NUM), jehož hodnota je: $(VALUE)"; + Text[ hebrew ] = "Datenpunkt $(PT_NUM) in Reihe $(ROW_NUM) markiert, Wert: $(VALUE)"; + Text[ hindi ] = "पंक्ति $(ROW_NUM) में ड़ॉटा बिन्दु $(PT_NUM) को चुना है, मूल्य: $(VALUE)"; + Text[ slovak ] = "Dátový bod $(PT_NUM) na riadku $(ROW_NUM) vybraný, hodnota: $(VALUE)"; +}; + +String STR_QUICKHELP_DATAPOINT +{ + Text = "Datenpunkt $(PT_NUM), Reihe $(ROW_NUM), Wert: $(VALUE)"; + Text [ english_us ] = "Data Point $(PT_NUM), row $(ROW_NUM), value: $(VALUE)"; + Text[ portuguese ] = "Ponto de dados $(PT_NUM), srie $(ROW_NUM), valor: $(VALUE)"; + Text[ russian ] = " $(PT_NUM), $(ROW_NUM), : $(VALUE)"; + Text[ greek ] = " $(PT_NUM), $(ROW_NUM), : $(VALUE)"; + Text[ dutch ] = "Gegevenspunt $(PT_NUM), rij $(ROW_NUM), waarde: $(VALUE)"; + Text[ french ] = "Point de donnes $(PT_NUM), srie $(ROW_NUM), valeur : $(VALUE)"; + Text[ spanish ] = "Punto de dato $(PT_NUM), fila $(ROW_NUM), valor: $(VALUE)"; + Text[ italian ] = "Punto dati $(PT_NUM), serie $(ROW_NUM), valore: $(VALUE)"; + Text[ danish ] = "Datapunkt $(PT_NUM), serie $(ROW_NUM), vrdi: $(VALUE)"; + Text[ swedish ] = "Datapunkt $(PT_NUM), serie $(ROW_NUM), vrde: $(VALUE)"; + Text[ polish ] = "Punkt danych $(PT_NUM), wiersz $(ROW_NUM), warto: $(VALUE)"; + Text[ portuguese_brazilian ] = "Ponto de dados $(PT_NUM), linha $(ROW_NUM), valor: $(VALUE)"; + Text[ japanese ] = "データ ポイント$(PT_NUM)、系列$(ROW_NUM)、数値: $(VALUE)"; + Text[ korean ] = "열 $(ROW_NUM)의 데이터 포인트 $(PT_NUM), 값: $(VALUE)"; + Text[ chinese_simplified ] = "数据点$(PT_NUM),数据系列$(ROW_NUM),数值:$(VALUE)"; + Text[ chinese_traditional ] = "資料點 $(PT_NUM),欄 $(ROW_NUM),數值:$(VALUE)"; + Text[ arabic ] = " $(PT_NUM) $(ROW_NUM) : $(VALUE)"; + Text[ turkish ] = "$(ROW_NUM) dizisindeki $(PT_NUM) veri noktas iaretlendi. Deeri: $(VALUE)"; + Text[ catalan ] = "Punt de dades $(PT_NUM), fila $(ROW_NUM), valor: $(VALUE)"; + Text[ finnish ] = "Arvopiste $(PT_NUM), rivi $(ROW_NUM), arvo: $(VALUE)"; + Text[ thai ] = "จุดข้อมูล $(PT_NUM), แถว $(ROW_NUM), ค่า: $(VALUE)"; + Text[ czech ] = "Datový bod $(PT_NUM), řádek $(ROW_NUM), hodnota: $(VALUE)"; + Text[ hebrew ] = "Datenpunkt $(PT_NUM), Reihe $(ROW_NUM), Wert: $(VALUE)"; + Text[ hindi ] = "ड़ॉटा बिन्दु $(PT_NUM), पंक्ति $(ROW_NUM), मूल्य: $(VALUE)"; + Text[ slovak ] = "Dátový bod $(PT_NUM), riadok $(ROW_NUM), hodnota: $(VALUE)"; +}; + +String STR_BALLOONHELP_DATAPOINT +{ + // $(NEWLINE) begins a new line, $(PT_STR) and $(ROW_STR) are the + // row/column captions + + Text = "Datenpunkt $(PT_STR)$(NEWLINE)Reihe $(ROW_STR)$(NEWLINE)Wert: $(VALUE)"; + Text [ english_us ] = "Data Point $(PT_STR)$(NEWLINE)row $(ROW_STR)$(NEWLINE)value: $(VALUE)"; + Text[ portuguese ] = "Ponto de dados $(PT_STR)$(NEWLINE)srie $(ROW_STR)$(NEWLINE)valor: $(VALUE)"; + Text[ russian ] = " $(PT_STR)$(NEWLINE) $(ROW_STR)$(NEWLINE): $(VALUE)"; + Text[ greek ] = " $(PT_STR)$(NEWLINE) $(ROW_NUM): $(VALUE)"; + Text[ dutch ] = "Gegevenspunt $(PT_STR)$(NEWLINE)rij $(ROW_STR)$(NEWLINE)waarde: $(VALUE)"; + Text[ french ] = "Point de donnes $(PT_STR)$(NEWLINE)srie $(ROW_STR)$(NEWLINE)valeur : $(VALUE)"; + Text[ spanish ] = "Punto de dato $(PT_STR)$(NEWLINE)fila $(ROW_STR)$(NEWLINE)valor: $(VALUE)"; + Text[ italian ] = "Punto dati $(PT_STR)$(NEWLINE)serie $(ROW_STR)$(NEWLINE)valore: $(VALUE)"; + Text[ danish ] = "Datapunkt $(PT_STR)$(NEWLINE)serie $(ROW_STR)$(NEWLINE)vrdi: $(VALUE)"; + Text[ swedish ] = "Datapunkt $(PT_STR)$(NEWLINE)serie $(ROW_STR)$(NEWLINE)vrde: $(VALUE)"; + Text[ polish ] = "Punkt danych $(PT_STR)$(NEWLINE)wiersz $(ROW_STR)$(NEWLINE)warto: $(VALUE)"; + Text[ portuguese_brazilian ] = "Ponto de dados $(PT_STR)$(NEWLINE)linha $(ROW_STR)$(NEWLINE)valor: $(VALUE)"; + Text[ japanese ] = "データポイント$(PT_STR)$(NEWLINE)系列 $(ROW_STR)$(NEWLINE)数値: $(VALUE)"; + Text[ korean ] = "데이터 포인트 $(PT_STR)$(NEWLINE) 열 $(ROW_STR)$(NEWLINE) 값: $(VALUE)"; + Text[ chinese_simplified ] = "数据点$(PT_STR)$(NEWLINE)数据系列$(ROW_STR)$(NEWLINE)数值:$(VALUE)"; + Text[ chinese_traditional ] = "資料點 $(PT_STR)$(NEWLINE)欄$(ROW_STR)$(NEWLINE)數值:$(VALUE)"; + Text[ arabic ] = " $(PT_STR)$(NEWLINE) $(ROW_STR)$(NEWLINE): $(VALUE)"; + Text[ turkish ] = "Veri noktas $(PT_STR)$(NEWLINE)Dizi $(ROW_STR)$(NEWLINE)Deer: $(VALUE)"; + Text[ catalan ] = "Punt de dades $(PT_STR)$(NEWLINE)fila $(ROW_STR)$(NEWLINE)valor: $(VALUE)"; + Text[ finnish ] = "Arvopiste $(PT_STR)$(NEWLINE)rivi $(ROW_STR)$(NEWLINE)arvo: $(VALUE)"; + Text[ thai ] = "จุดข้อมูล $(PT_STR)$(NEWLINE)แถว $(ROW_STR)$(NEWLINE)ค่า: $(VALUE)"; + Text[ czech ] = "Datový bod $(PT_STR)$(NEWLINE)řádek $(ROW_STR)$(NEWLINE)hodnota: $(VALUE)"; + Text[ hebrew ] = "Datenpunkt $(PT_STR)$(NEWLINE)Reihe $(ROW_STR)$(NEWLINE)Wert: $(VALUE)"; + Text[ hindi ] = "Data Point $(PT_STR)$(NEWLINE)row $(ROW_STR)$(NEWLINE)value: $(VALUE)"; + Text[ slovak ] = "Dátový bod $(PT_STR)$(NEWLINE)riadok $(ROW_STR)$(NEWLINE)hodnota: $(VALUE)"; +}; + +// some more strings for QuickHelp + +String STR_AVERAGEVALUE +{ + Text = "Mittelwertlinie"; + Text [ english_us ] = "average value line"; + Text[ portuguese ] = "Linha de mdia"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "Gemiddelde waarde lijn"; + Text[ french ] = "Ligne de moyenne"; + Text[ spanish ] = "Lnea de valor medio"; + Text[ italian ] = "Linea di valore medio"; + Text[ danish ] = "Middelvrdilinje"; + Text[ swedish ] = "Medelvrdeslinje"; + Text[ polish ] = "Linia redniej"; + Text[ portuguese_brazilian ] = "Linha de valor mdio"; + Text[ japanese ] = "平均値線"; + Text[ korean ] = "평균값 선"; + Text[ chinese_simplified ] = "平均值线"; + Text[ chinese_traditional ] = "平均值線"; + Text[ arabic ] = " "; + Text[ turkish ] = "Ortalama deer izgisi"; + Text[ catalan ] = "Lnia de promig"; + Text[ finnish ] = "rivin keskiarvo"; + Text[ thai ] = "บรรทัดค่าเฉลี่ย"; + Text[ czech ] = "čára průměru"; + Text[ hebrew ] = "Mittelwertlinie"; + Text[ hindi ] = "मध्यम मूल्य रेखा"; + Text[ slovak ] = "čiara priemernej hodnoty"; +}; + +String STR_DIAGRAM_ERROR +{ + Text = "Fehlerindikator"; + Text [ english_us ] = "error indicator"; + Text[ portuguese ] = "Indicador de erro"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "Foutindicator"; + Text[ french ] = "Indicateur d'erreurs"; + Text[ spanish ] = "Indicador de error"; + Text[ italian ] = "Indicatore di errore"; + Text[ danish ] = "Fejlindikator"; + Text[ swedish ] = "Felindikator"; + Text[ polish ] = "Wskanik bdu"; + Text[ portuguese_brazilian ] = "indicador de erro"; + Text[ japanese ] = "誤差インジケータ"; + Text[ korean ] = "오류 표시기"; + Text[ chinese_simplified ] = "显示错误"; + Text[ chinese_traditional ] = "顯示錯誤"; + Text[ arabic ] = " "; + Text[ turkish ] = "Hata gstergesi"; + Text[ catalan ] = "indicador d'error"; + Text[ finnish ] = "virheilmaisin"; + Text[ thai ] = "ตัวบ่งชี้ผิดพลาด"; + Text[ czech ] = "chybový indikátor"; + Text[ hebrew ] = "Fehlerindikator"; + Text[ hindi ] = "गलत निदर्शक"; + Text[ slovak ] = "indikátor chýb"; +}; + +String STR_DIAGRAM_REGRESSION +{ + Text = "Regressionskurve"; + Text [ english_us ] = "regression curve"; + Text[ portuguese ] = "Curva regressiva"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "Regressieboog"; + Text[ french ] = "Courbe de rgression"; + Text[ spanish ] = "Curva de regresin"; + Text[ italian ] = "Curva di regressione"; + Text[ danish ] = "Regressionskurve"; + Text[ swedish ] = "Regressionskurva"; + Text[ polish ] = "Krzywa regresji"; + Text[ portuguese_brazilian ] = "Curva de regresso"; + Text[ japanese ] = "回帰曲線"; + Text[ korean ] = "회귀 곡선"; + Text[ chinese_simplified ] = "回归曲线"; + Text[ chinese_traditional ] = "迴歸曲線"; + Text[ arabic ] = " "; + Text[ turkish ] = "Regresyon erisi"; + Text[ catalan ] = "Corba de regressi"; + Text[ finnish ] = "regressiokyr"; + Text[ thai ] = "เส้นโค้งถดถอย"; + Text[ czech ] = "regresní křivka"; + Text[ hebrew ] = "Regressionskurve"; + Text[ hindi ] = "रिग्रेश्यन वक्र"; + Text[ slovak ] = "regresná krivka"; +}; + +String STR_CFG_DEFAULT_COLORS +{ + Text = "Grundfarben"; + Text [ english_us ] = "Default colors"; + Text[ portuguese ] = "Cores padro"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "Basiskleuren"; + Text[ french ] = "Couleurs par dfaut"; + Text[ spanish ] = "Colores predeterminados"; + Text[ italian ] = "Colori di base"; + Text[ danish ] = "Standardfarver"; + Text[ swedish ] = "Grundfrger"; + Text[ polish ] = "Kolory domylne"; + Text[ portuguese_brazilian ] = "Cores padro"; + Text[ japanese ] = "基本色"; + Text[ korean ] = "기본 색상"; + Text[ chinese_simplified ] = "基本色"; + Text[ chinese_traditional ] = "基色"; + Text[ arabic ] = " "; + Text[ turkish ] = "Temel renkler"; + Text[ catalan ] = "Colors per defecte"; + Text[ finnish ] = "Oletusvrit"; + Text[ thai ] = "ค่าสีเริ่มต้น"; + Text[ czech ] = "Výchozí barvy"; + Text[ hebrew ] = "Grundfarben"; + Text[ hindi ] = "अनुपस्थिति रंग"; + Text[ slovak ] = "Východzie farby"; +}; + +String STR_PIE_SEGMENT_EXPLODED +{ // shown in status bar. Parameter $(PERCENT) becomes a floating point number + Text = "Tortenstck $(PERCENT) Prozent explodiert"; + Text[ ENGLISH ] = "Pie exploded $(PERCENT) percent"; + Text[ english ] = "Pie exploded $(PERCENT) percent"; + Text[ english_us ] = "Pie exploded by $(PERCENT) percent"; + Text[ portuguese ] = "Sector explodiu a $(PERCENT) por cento"; + Text[ russian ] = " $(PERCENT) "; + Text[ greek ] = " $(PERCENT) "; + Text[ dutch ] = "Taartstuk $(PERCENT) percent gexplodeerd"; + Text[ french ] = "Secteur clat $(PERCENT) pour cent"; + Text[ spanish ] = "Sector separado: $(PERCENT) porciento "; + Text[ italian ] = "Settore esploso del $(PERCENT) percento"; + Text[ danish ] = "Lagkagestykke $(PERCENT) procent eksploderet"; + Text[ swedish ] = "Trtbit exploderat $(PERCENT) procent"; + Text[ polish ] = "Wykres koowy rozsunity o $(PERCENT) procent"; + Text[ portuguese_brazilian ] = "Pizza explodida em $(PERCENT) por cento"; + Text[ japanese ] = "切片を $(PERCENT)パーセント切り開く"; + Text[ korean ] = "케이크 조각$(PERCENT) 백분율 분할"; + Text[ chinese_simplified ] = "圆饼分裂成 $(PERCENT)(百分比)"; + Text[ chinese_traditional ] = "圓形分裂成 $(PERCENT)百分比"; + Text[ arabic ] = " $(PERCENT) "; + Text[ turkish ] = "Yzde oranlarna $(PERCENT) gre ayrlm pasta grafii"; + Text[ catalan ] = "El diagrama de sectors s'ha ampliat d'un $(PERCENT) per cent"; + Text[ finnish ] = "Kaavio-osuuden laajennus $(PERCENT) %"; + Text[ thai ] = "ทำให้พายแตกโดย $(PERCENT) เปอร์เซ็นต์"; + Text[ czech ] = "Koláč vytažený o $(PERCENT) procent"; + Text[ hebrew ] = "Tortenstück $(PERCENT) Prozent explodiert"; + Text[ hindi ] = "$(PERCENT) प्रतिशत वृतखण्ड फूट पड़ा है"; + Text[ slovak ] = "Koláč roztiahnutý o (PERCENT) percent"; +}; + +String STR_DIAGRAM_DATA_SAFETY_QUERY +{ + Text = "Die Daten wurden gendert.\Sollen die nderungen bernommen werden?" ; + Text[ English ] = "The data has been modified.\n Do you want to apply the changes?" ; + Text[ english_us ] = "Data has been changed.\n Do you want to apply the changes?" ; + Text[ portuguese ] = "Os dados foram modificados.\n Aplicar as modificaes?"; + Text[ russian ] = " .\n ?"; + Text[ greek ] = " .\n ;"; + Text[ dutch ] = "Gegevens zijn gewijzigd.\nWijzigingen overnemen?"; + Text[ french ] = "Les donnes ont t modifies.\nVoulez-vous appliquer les modifications ?"; + Text[ spanish ] = "Los datos han sido modificados.\n Desea aplicar las modificaciones?"; + Text[ italian ] = "I dati sono stai modificati.\\Volete applicare le modifiche?"; + Text[ danish ] = "Dataene er blevet ndret.\nSkal ndringerne overtages?"; + Text[ swedish ] = "Data har ndrats.\nSkall ndringarna vertas?"; + Text[ polish ] = "Dane zostay zmienione.\nCzy chcesz zastosowa zmiany?"; + Text[ portuguese_brazilian ] = "Os dados foram modificados.\n Aplicar as modificaes?"; + Text[ japanese ] = "データが変更されています。\n変更を適用しますか。"; + Text[ korean ] = "데이터가 변경되었습니다.\n 변경 내용을 적용하겠습니까?"; + Text[ chinese_simplified ] = "数据已经被更改。\n 要采用更改后的数据内容吗?"; + Text[ chinese_traditional ] = "資料已經變更。\n 接受變更的資料?"; + Text[ turkish ] = "Veri deitirildi.\n Deiiklikleri uygulamak ister misiniz?"; + Text[ arabic ] = " .\n ʿ"; + Text[ catalan ] = "Les dades han canviat.\n Voleu aplicar els canvis?"; + Text[ finnish ] = "Tietoja on muutettu.\nHaluatko ottaa muutokset kyttn?"; + Text[ thai ] = "ข้อมูลได้เปลี่ยนแปลงแล้ว.\n คุณต้องการใช้สิ่งที่เปลี่ยนแปลงหรือไม่?"; + Text[ czech ] = "Data byla změněna.\nChcete změny použít?"; + Text[ hebrew ] = "Die Daten wurden geändert.\\Sollen die Änderungen übernommen werden?"; + Text[ hindi ] = "ड़ॉटा को परिवर्तन किया गया है ।\n आप परिवर्तनों को लागू करना चाहते है ?"; + Text[ slovak ] = "Dáta sa zmenili.\nChcete použiť tieto zmeny?"; +}; + +String STR_UNDO_TRANSFORM +{ + Text = "%O transformieren" ; + Text [ ENGLISH ] = "Transform %O" ; + Text [ norwegian ] = "Omform %O" ; + Text [ italian ] = "Trasforma %O" ; + Text [ portuguese_brazilian ] = "Transformar %O" ; + Text [ portuguese ] = "Transformar %O" ; + Text [ finnish ] = "Muunna %O" ; + Text [ danish ] = "Transformer %O" ; + Text [ french ] = "Transformer %O" ; + Text [ swedish ] = "Omvandla %O" ; + Text [ dutch ] = "%O transformeren" ; + Text [ spanish ] = "Transformar %O" ; + Text [ english_us ] = "Transform %O" ; + Text[ chinese_simplified ] = "转换 %O"; + Text[ russian ] = " %O"; + Text[ polish ] = "Przekszta %O"; + Text[ japanese ] = "%Oを変換"; + Text[ chinese_traditional ] = "轉換 %O"; + Text[ arabic ] = " %O"; + Text[ dutch ] = "%O transformeren"; + Text[ chinese_simplified ] = "转换 %O"; + Text[ greek ] = " %O"; + Text[ korean ] = "%O 변형"; + Text[ turkish ] = "Dnm %O"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Transformar %O"; + Text[ thai ] = "เปลี่ยนรูป %O"; + Text[ czech ] = "Transformuj %O"; + Text[ hebrew ] = "%O transformieren"; + Text[ hindi ] = "परिवर्तन %O"; + Text[ slovak ] = "Transformovať %O"; +}; + +String STR_UNDO_MOVE +//== svx STR_EditMove +{ + Text = "%O verschieben" ; + Text [ ENGLISH ] = "Move %O" ; + Text [ norwegian ] = "Flytt %O" ; + Text [ italian ] = "Sposta %O" ; + Text [ portuguese_brazilian ] = "Mover %O" ; + Text [ portuguese ] = "Mover %O" ; + Text [ finnish ] = "Siirr %O" ; + Text [ danish ] = "Flyt %O" ; + Text [ french ] = "Dplacer %O" ; + Text [ swedish ] = "Flytta %O" ; + Text [ dutch ] = "%O verplaatsen" ; + Text [ spanish ] = "Desplazar %O" ; + Text [ english_us ] = "Move %O" ; + Text[ chinese_simplified ] = "移动 %O"; + Text[ russian ] = " %O"; + Text[ polish ] = "Przenie %O"; + Text[ japanese ] = "%Oを移動"; + Text[ chinese_traditional ] = "移動 %O"; + Text[ arabic ] = " %O"; + Text[ dutch ] = "%O verplaatsen"; + Text[ chinese_simplified ] = "移动 %O"; + Text[ greek ] = " %O"; + Text[ korean ] = "%O 이동"; + Text[ turkish ] = "Ta %O"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Desplazar %O"; + Text[ thai ] = "ย้าย %O"; + Text[ czech ] = "Posuň %O"; + Text[ hebrew ] = "%O verschieben"; + Text[ hindi ] = "%O को स्थान परिवर्तन करो"; + Text[ slovak ] = "Presunúť %O"; +}; + +String STR_UNDO_RESIZE +//== svx STR_EditResize +{ + Text = "Gre von %O ndern" ; + Text [ ENGLISH ] = "Resize %O" ; + Text [ norwegian ] = "Endre strrelse p %O" ; + Text [ italian ] = "Ridimensiona %O" ; + Text [ portuguese_brazilian ] = "Redimensionar %O" ; + Text [ portuguese ] = "Redimensionar %O" ; + Text [ finnish ] = "Muuta kohteen %O kokoa" ; + Text [ danish ] = "Modificer strrelse p %O" ; + Text [ french ] = "Redimensionner %O" ; + Text [ swedish ] = "Frndra storleken p %O" ; + Text [ dutch ] = "Grootte van %O wijzigen" ; + Text [ spanish ] = "Modificar el tamao de %O" ; + Text [ english_us ] = "Resize %O" ; + Text[ chinese_simplified ] = "更改 %O 大小"; + Text[ russian ] = " %O"; + Text[ polish ] = "Zmie rozmiar %O"; + Text[ japanese ] = "%Oのサイズを変更"; + Text[ chinese_traditional ] = "變更 %O 大小"; + Text[ arabic ] = " %O"; + Text[ dutch ] = "Grootte van %O wijzigen"; + Text[ chinese_simplified ] = "更改 %O 大小"; + Text[ greek ] = " %O"; + Text[ korean ] = "%O의 크기 변경"; + Text[ turkish ] = "%0 'yu yendein boyutlandr"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Modificar tamao de %O"; + Text[ thai ] = "ปรับขนาด %O"; + Text[ czech ] = "Změň velikost %O"; + Text[ hebrew ] = "Größe von %O ändern"; + Text[ hindi ] = "%O को पुनः परिमाण दो"; + Text[ slovak ] = "Zmeniť veľkosť %O"; +}; + +String STR_UNDO_ROTATE +//== svx STR_EditRotate +{ + Text = "%O drehen" ; + Text [ ENGLISH ] = "Rotate %O" ; + Text [ norwegian ] = "Roter %O" ; + Text [ italian ] = "Ruota %O" ; + Text [ portuguese_brazilian ] = "Rotar %O" ; + Text [ portuguese ] = "Rodar %O" ; + Text [ finnish ] = "Kierr kohdetta %O" ; + Text [ danish ] = "Roter %O" ; + Text [ french ] = "Pivoter %O" ; + Text [ swedish ] = "Rotera %O" ; + Text [ dutch ] = "%O draaien" ; + Text [ spanish ] = "Rodar %O" ; + Text [ english_us ] = "Rotate %O" ; + Text[ chinese_simplified ] = "旋转 %O"; + Text[ russian ] = " %O"; + Text[ polish ] = "Obr %O"; + Text[ japanese ] = "%Oを回転"; + Text[ chinese_traditional ] = "旋轉 %O"; + Text[ arabic ] = " %O"; + Text[ dutch ] = "%O draaien"; + Text[ chinese_simplified ] = "旋转 %O"; + Text[ greek ] = " %O"; + Text[ korean ] = "%O 회전"; + Text[ turkish ] = "%O 'yu evir"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Rodar %O"; + Text[ thai ] = "หมุน %O"; + Text[ czech ] = "Otoč %0"; + Text[ hebrew ] = "%O drehen"; + Text[ hindi ] = "%O को घुमाओ"; + Text[ slovak ] = "Otočiť %O"; +}; +*/ +//----------------------------------- diff --git a/chart2/source/controller/dialogs/Strings_ChartTypes.src b/chart2/source/controller/dialogs/Strings_ChartTypes.src new file mode 100644 index 000000000000..eb14a6eea3f0 --- /dev/null +++ b/chart2/source/controller/dialogs/Strings_ChartTypes.src @@ -0,0 +1,1813 @@ +/************************************************************************* + * + * $RCSfile: Strings_ChartTypes.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Strings.hrc" + +String STR_LINES +{ + Text = "Linien" ; + Text [ ENGLISH ] = "Lines" ; + Text [ norwegian ] = "Linjer" ; + Text [ italian ] = "Linee" ; + Text [ portuguese_brazilian ] = "Linhas" ; + Text [ portuguese ] = "Linhas" ; + Text [ finnish ] = "Rivit" ; + Text [ danish ] = "Linjer" ; + Text [ french ] = "Lignes" ; + Text [ swedish ] = "Linjer" ; + Text [ dutch ] = "Lijnen" ; + Text [ spanish ] = "Lneas" ; + Text [ english_us ] = "Lines" ; + Text[ chinese_simplified ] = "线条"; + Text[ russian ] = ""; + Text[ polish ] = "Linie"; + Text[ japanese ] = "折れ線"; + Text[ chinese_traditional ] = "線條"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "선"; + Text[ turkish ] = "izgi"; + Text[ catalan ] = "Lnies"; + Text[ thai ] = "บรรทัด"; + Text[ czech ] = "Řádky"; + Text[ hebrew ] = "Linien"; + Text[ hindi ] = "Lines"; + Text[ slovak ] = "Čiarový graf"; +}; +String STR_COLUMNS +{ + Text = "Sulen" ; + Text [ ENGLISH ] = "Columns" ; + Text [ norwegian ] = "Kolonner" ; + Text [ italian ] = "Colonne" ; + Text [ portuguese_brazilian ] = "Colunas" ; + Text [ portuguese ] = "Barras" ; + Text [ finnish ] = "Pylvs" ; + Text [ danish ] = "Sjler" ; + Text [ french ] = "Colonnes" ; + Text [ swedish ] = "Staplar" ; + Text [ dutch ] = "kolommen" ; + Text [ spanish ] = "Columnas" ; + Text [ english_us ] = "Columns" ; + Text[ chinese_simplified ] = "柱"; + Text[ russian ] = ""; + Text[ polish ] = "Kolumny"; + Text[ japanese ] = "縦棒"; + Text[ chinese_traditional ] = "柱"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "단"; + Text[ turkish ] = "Stun"; + Text[ catalan ] = "Columnes"; + Text[ thai ] = "คอลัมน์์"; + Text[ czech ] = "Sloupce"; + Text[ hebrew ] = "טורים"; + Text[ hindi ] = "स्तंभ"; + Text[ slovak ] = "Stĺpcový graf (zvisle)"; +}; +String STR_BARS +{ + Text = "Balken" ; + Text [ ENGLISH ] = "Bars" ; + Text [ norwegian ] = "Linjer" ; + Text [ italian ] = "Barre" ; + Text [ portuguese_brazilian ] = "Barras" ; + Text [ portuguese ] = "Barras" ; + Text [ finnish ] = "Palkit" ; + Text [ danish ] = "Liggende sjler" ; + Text [ french ] = "Barres" ; + Text [ swedish ] = "Liggande staplar" ; + Text [ dutch ] = "balken" ; + Text [ spanish ] = "Barras" ; + Text [ english_us ] = "Bars" ; + Text[ chinese_simplified ] = "条"; + Text[ russian ] = ""; + Text[ polish ] = "Supki"; + Text[ japanese ] = "横棒"; + Text[ language_user1 ] = ": - -"; + Text[ chinese_traditional ] = "條"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "바"; + Text[ turkish ] = "ubuk"; + Text[ catalan ] = "Barres"; + Text[ thai ] = "แถบ"; + Text[ czech ] = "Sloupky"; + Text[ hebrew ] = "Balken"; + Text[ hindi ] = "पट्टी"; + Text[ slovak ] = "Stĺpcový graf (vodorovne)"; +}; +String STR_AREAS +{ + Text = "Flchen" ; + Text [ ENGLISH ] = "Areas" ; + Text [ norwegian ] = "Omrder" ; + Text [ italian ] = "Aree" ; + Text [ portuguese_brazilian ] = "reas" ; + Text [ portuguese ] = "reas" ; + Text [ finnish ] = "Alueet" ; + Text [ danish ] = "Omrder" ; + Text [ french ] = "Zones" ; + Text [ swedish ] = "Ytor" ; + Text [ dutch ] = "vlakken" ; + Text [ spanish ] = "reas" ; + Text [ english_us ] = "Areas" ; + Text[ chinese_simplified ] = "平面"; + Text[ russian ] = ""; + Text[ polish ] = "Obszary"; + Text[ japanese ] = "エリア"; + Text[ chinese_traditional ] = "平面"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "면"; + Text[ turkish ] = "Yzey"; + Text[ catalan ] = "rees"; + Text[ thai ] = "พื้นที่"; + Text[ czech ] = "Oblasti"; + Text[ hebrew ] = "Flächen"; + Text[ hindi ] = "विस्तीर्ण"; + Text[ slovak ] = "Plošný graf"; +}; +String STR_CIRCLES +{ + Text = "Kreise" ; + Text [ ENGLISH ] = "Pies" ; + Text [ norwegian ] = "Sektorer" ; + Text [ italian ] = "Torta" ; + Text [ portuguese_brazilian ] = "Pizzas" ; + Text [ portuguese ] = "Sectores" ; + Text [ finnish ] = "Ympyrkaaviot" ; + Text [ danish ] = "Cirkler" ; + Text [ french ] = "Secteurs" ; + Text [ swedish ] = "Cirklar" ; + Text [ dutch ] = "cirkels" ; + Text [ spanish ] = "Crculos" ; + Text [ english_us ] = "Pies" ; + Text[ chinese_simplified ] = "圆"; + Text[ russian ] = ""; + Text[ polish ] = "Koa"; + Text[ japanese ] = "円"; + Text[ chinese_traditional ] = "圓"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "원형"; + Text[ turkish ] = "Daire"; + Text[ catalan ] = "Diagrames de sectors"; + Text[ thai ] = "พาย"; + Text[ czech ] = "Koláčový"; + Text[ hebrew ] = "Kreise"; + Text[ hindi ] = "वृतखण्ड"; + Text[ slovak ] = "Koláčový graf"; +}; + +String STR_DONUT1 +{ + Text = "Ringe" ; + Text [ ENGLISH ] = "Rings" ; + Text [ norwegian ] = "Sektorer" ; + Text [ italian ] = "Anelli" ; + Text [ portuguese_brazilian ] = "Anis" ; + Text [ portuguese ] = "Anis" ; + Text [ finnish ] = "Renkaat" ; + Text [ danish ] = "Kranse" ; + Text [ french ] = "Anneaux" ; + Text [ swedish ] = "Ringar" ; + Text [ dutch ] = "ringen" ; + Text [ spanish ] = "Anillos" ; + Text [ english_us ] = "Rings" ; + Text[ chinese_simplified ] = "环"; + Text[ russian ] = ""; + Text[ polish ] = "Piercienie"; + Text[ japanese ] = "ドーナツ"; + Text[ chinese_traditional ] = "環"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "링"; + Text[ turkish ] = "Halka"; + Text[ catalan ] = "Anells"; + Text[ thai ] = "วง"; + Text[ czech ] = "Kruhový"; + Text[ hebrew ] = "Ringe"; + Text[ hindi ] = "रिंग"; + Text[ slovak ] = "Prstencový graf"; +}; +/* +String STR_DONUT2 +{ + Text = "Ringe" ; + Text [ ENGLISH ] = "Rings" ; + Text [ norwegian ] = "Sektorer" ; + Text [ italian ] = "Anelli" ; + Text [ portuguese_brazilian ] = "Anis" ; + Text [ portuguese ] = "Anis" ; + Text [ finnish ] = "Renkaat" ; + Text [ danish ] = "Kranse" ; + Text [ french ] = "Anneaux" ; + Text [ swedish ] = "Ringar" ; + Text [ dutch ] = "ringen" ; + Text [ spanish ] = "Anillos" ; + Text [ english_us ] = "Rings" ; + Text[ chinese_simplified ] = "环"; + Text[ russian ] = ""; + Text[ polish ] = "Piercienie"; + Text[ japanese ] = "ドーナツ"; + Text[ chinese_traditional ] = "環"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "링"; + Text[ turkish ] = "Halka"; + Text[ catalan ] = "Anells"; + Text[ thai ] = "วง"; + Text[ czech ] = "Kruhový"; + Text[ hebrew ] = "Ringe"; + Text[ hindi ] = "रिंग"; + Text[ slovak ] = "Prstencový graf"; +}; +*/ + +//----------------------------------------------------------------------------- + +String STR_NORMAL +{ + Text = "Normal" ; + Text [ ENGLISH ] = "Normal" ; + Text [ norwegian ] = "Normal" ; + Text [ italian ] = "Normale" ; + Text [ portuguese_brazilian ] = "Normal" ; + Text [ portuguese ] = "Normal" ; + Text [ french ] = "Normal" ; + Text [ dutch ] = "Normaal" ; + Text [ spanish ] = "Normal" ; + Text [ danish ] = "Normal" ; + Text [ swedish ] = "Normal" ; + Text [ finnish ] = "Normaali" ; + Text [ english_us ] = "Normal" ; + Text[ chinese_simplified ] = "一般"; + Text[ russian ] = ""; + Text[ polish ] = "Zwyky"; + Text[ japanese ] = "標準"; + Text[ chinese_traditional ] = "一般"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "표준"; + Text[ turkish ] = "Normal"; + Text[ catalan ] = "Normal"; + Text[ thai ] = "ปกติ"; + Text[ czech ] = "Běžný"; + Text[ hebrew ] = "Normal"; + Text[ hindi ] = "नॉर्मल्"; + Text[ slovak ] = "Normálny graf"; +}; +String STR_STACKED +{ + Text = "Gestapelt" ; + Text [ ENGLISH ] = "Stacked" ; + Text [ norwegian ] = "Stablet" ; + Text [ italian ] = "Sovrapposto" ; + Text [ portuguese_brazilian ] = "Empilhado" ; + Text [ portuguese ] = "Empilhado" ; + Text [ french ] = "Empil" ; + Text [ dutch ] = "Gestapeld" ; + Text [ spanish ] = "En pilas" ; + Text [ danish ] = "Stablet" ; + Text [ swedish ] = "Staplat" ; + Text [ finnish ] = "Pinottuna" ; + Text [ english_us ] = "Stacked" ; + Text[ chinese_simplified ] = "重叠"; + Text[ russian ] = " "; + Text[ polish ] = "Skumulowany"; + Text[ japanese ] = "積み上げ"; + Text[ chinese_traditional ] = "重疊"; + Text[ arabic ] = ""; + Text[ greek ] = " "; + Text[ korean ] = "누적된"; + Text[ turkish ] = "Ylm"; + Text[ catalan ] = "Apilat"; + Text[ thai ] = "กองซ้อน"; + Text[ czech ] = "Skládaný"; + Text[ hebrew ] = "Gestapelt"; + Text[ hindi ] = "Stacked"; + Text[ slovak ] = "Skladaný graf"; +}; +String STR_PERCENT +{ + Text = "Prozent" ; + Text [ ENGLISH ] = "Percent" ; + Text [ norwegian ] = "Prosent" ; + Text [ italian ] = "Percentuale" ; + Text [ portuguese_brazilian ] = "Percentual" ; + Text [ portuguese ] = "Percentual" ; + Text [ french ] = "Pourcentage" ; + Text [ dutch ] = "Procent" ; + Text [ spanish ] = "Porcentaje" ; + Text [ danish ] = "Procent" ; + Text [ swedish ] = "Procent" ; + Text [ finnish ] = "Prosenttia" ; + Text [ english_us ] = "Percent" ; + Text[ chinese_simplified ] = "百分比"; + Text[ russian ] = ""; + Text[ polish ] = "Procent"; + Text[ japanese ] = "パーセント"; + Text[ chinese_traditional ] = "百分比"; + Text[ arabic ] = " "; + Text[ greek ] = " (%)"; + Text[ korean ] = "백분율"; + Text[ turkish ] = "Yzde"; + Text[ catalan ] = "Percentatge"; + Text[ thai ] = "เปอร์เซ็นต์"; + Text[ czech ] = "Procentuální"; + Text[ hebrew ] = "Prozent"; + Text[ hindi ] = "प्रतिशत"; + Text[ slovak ] = "Percentuálny graf"; +}; + +String STR_DEEP +{ + Text = "Tief" ; + Text [ ENGLISH ] = "Deep" ; + Text [ norwegian ] = "Deep" ; + Text [ italian ] = "In profondit" ; + Text [ portuguese_brazilian ] = "Profundo" ; + Text [ portuguese ] = "Fundo" ; + Text [ french ] = "Profond" ; + Text [ dutch ] = "met diepte" ; + Text [ spanish ] = "Profundidad" ; + Text [ danish ] = "Dyb" ; + Text [ swedish ] = "Djup" ; + Text [ finnish ] = "Syvyys" ; + Text [ english_us ] = "Deep" ; + Text[ chinese_simplified ] = "深度"; + Text[ russian ] = ""; + Text[ polish ] = "Gboki"; + Text[ japanese ] = "奥行きあり"; + Text[ chinese_traditional ] = "深度"; + Text[ arabic ] = ""; + Text[ greek ] = " "; + Text[ korean ] = "깊이"; + Text[ turkish ] = "Derin"; + Text[ catalan ] = "Profund"; + Text[ thai ] = "ลึก"; + Text[ czech ] = "Hloubka"; + Text[ hebrew ] = "Tief"; + Text[ hindi ] = "गहरा"; + Text[ slovak ] = "Hĺbkový graf"; +}; + +String STR_OFS +{ + // comment + Text[ language_user1 ] = "BM: Parameter $(N) is replaced by 1 or 2 for different offset types"; + // comment + Text = "Offset $(N)" ; + Text [ ENGLISH ] = "Offset $(N)" ; + Text [ english_us ] = "Offset $(N)" ; + Text [ italian ] = "Offset $(N)" ; + Text [ spanish ] = "Offset $(N)" ; + Text [ french ] = "Offset $(N)" ; + Text [ dutch ] = "Offset $(N)" ; + Text [ swedish ] = "Offset $(N)" ; + Text [ danish ] = "Offset $(N)" ; + Text [ portuguese ] = "Offset $(N)" ; + Text [ portuguese_brazilian ] = "Offset $(N)" ; + Text[ chinese_simplified ] = "偏移$(N)"; + Text[ russian ] = " $(N)"; + Text[ polish ] = "Przesunicie $(N)"; + Text[ japanese ] = "オフセット $(N)"; + Text[ chinese_traditional ] = "偏移 $(N)"; + Text[ arabic ] = " $(N)"; + Text[ greek ] = " $(N)"; + Text[ korean ] = "오프셋$(N)"; + Text[ turkish ] = "Ofset $(N)"; + Text[ catalan ] = "Offset $(N)"; + Text[ finnish ] = "Siirtym $(N)"; + Text[ thai ] = "ออฟเซต $(N)"; + Text[ czech ] = "Odchylka $(N)"; + Text[ hebrew ] = "Offset $(N)"; + Text[ hindi ] = "ऑफ़सेट् $(N)"; + Text[ slovak ] = "Ofsetový (oddelené koláče) $(N)"; +}; + +//----------------------------------------------------------------------------- +/* +String STR_LINESYMB +{ + Text = "Linien mit Symbolen" ; + Text [ ENGLISH ] = "Lines with symbols" ; + Text [ english_us ] = "Lines with Symbols" ; + Text [ italian ] = "Linee con simboli" ; + Text [ spanish ] = "Lneas con smbolos" ; + Text [ french ] = "Lignes avec symboles" ; + Text [ dutch ] = "Lijnen met symbolen" ; + Text [ swedish ] = "Linjer med symboler" ; + Text [ danish ] = "Linjer med mrker" ; + Text [ portuguese_brazilian ] = "Linhas com Smbolos" ; + Text [ portuguese ] = "Linhas com smbolos" ; + Text[ chinese_simplified ] = "带图标的线条"; + Text[ russian ] = " "; + Text[ polish ] = "Linie z symbolami"; + Text[ japanese ] = "データポイント付き折れ線"; + Text[ chinese_traditional ] = "圖示線條"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "기호가 포함된 선"; + Text[ turkish ] = "Simgeli izgi"; + Text[ catalan ] = "Lnies amb smbols"; + Text[ finnish ] = "Viivat ja symbolit"; + Text[ thai ] = "บรรทัดกับสัญลักษณ์"; + Text[ czech ] = "Čáry se symboly"; + Text[ hebrew ] = "Linien mit Symbolen"; + Text[ hindi ] = "संकेत सहित रेखाएँ"; + Text[ slovak ] = "Čiarový graf so symbolmi"; +}; +*/ +String STR_XY +{ + Text = "XY-Diagramm" ; + Text [ ENGLISH ] = "XY diagram" ; + Text [ dutch ] = "XY-diagram" ; + Text [ english_us ] = "XY Chart" ; + Text [ italian ] = "Diagramma XY" ; + Text [ spanish ] = "Diagrama XY" ; + Text [ french ] = "Diagramme XY" ; + Text [ swedish ] = "XY-diagram" ; + Text [ danish ] = "XY-diagram" ; + Text [ portuguese ] = "Grfico XY" ; + Text [ portuguese_brazilian ] = "Grfico XY" ; + Text[ chinese_simplified ] = "XY 图表"; + Text[ russian ] = " XY"; + Text[ polish ] = "Wykres XY"; + Text[ japanese ] = "散布図"; + Text[ chinese_traditional ] = "XY-圖表"; + Text[ arabic ] = " "; + Text[ greek ] = " XY"; + Text[ korean ] = "XY 차트"; + Text[ turkish ] = "XY emas"; + Text[ catalan ] = "Diagrama XY"; + Text[ finnish ] = "XY-kaavio"; + Text[ thai ] = "แผนภูมิXY "; + Text[ czech ] = "Graf XY"; + Text[ hebrew ] = "XY-Diagramm"; + Text[ hindi ] = "XY चार्ट"; + Text[ slovak ] = "Graf XY"; +}; +/* +String STR_XYZ +{ + Text = "XYZ-Diagramm" ; + Text [ ENGLISH ] = "XYZ diagram" ; + Text [ dutch ] = "XYZ-diagram" ; + Text [ english_us ] = "XYZ Chart" ; + Text [ italian ] = "Diagramma XYZ" ; + Text [ spanish ] = "Diagrama XYZ" ; + Text [ french ] = "Diagramme XYZ" ; + Text [ swedish ] = "XYZ-diagram" ; + Text [ danish ] = "XYZ-diagram" ; + Text [ portuguese ] = "Grfico XYZ" ; + Text [ portuguese_brazilian ] = "Grfico XYZ" ; + Text[ chinese_simplified ] = "XYZ 图表"; + Text[ russian ] = " XYZ"; + Text[ polish ] = "Wykres XYZ"; + Text[ japanese ] = "XYZ軸図表"; + Text[ chinese_traditional ] = "XYZ-圖表"; + Text[ arabic ] = " "; + Text[ greek ] = " XYZ"; + Text[ korean ] = "XYZ 차트"; + Text[ turkish ] = "XYZ emas"; + Text[ catalan ] = "Diagrama XYZ"; + Text[ finnish ] = "XYZ-kaavio"; + Text[ thai ] = "แผนภูมิXYZ "; + Text[ czech ] = "Graf XYZ"; + Text[ hebrew ] = "XYZ-Diagramm"; + Text[ hindi ] = "XYZ चार्ट "; + Text[ slovak ] = "Graf XYZ"; +}; +*/ +String STR_ONLY_SYMBOLS +{ + Text = "Nur Symbole" ; + Text [ ENGLISH ] = "Only symbols" ; + Text [ english_us ] = "Symbols Only" ; + Text [ dutch ] = "Alleen symbolen" ; + Text [ italian ] = "Solo simboli" ; + Text [ spanish ] = "Slo smbolos" ; + Text [ french ] = "Uniquement symboles" ; + Text [ swedish ] = "Endast symboler" ; + Text [ danish ] = "Kun mrker" ; + Text [ portuguese ] = "S smbolos" ; + Text [ portuguese_brazilian ] = "Somente Smbolos" ; + Text[ chinese_simplified ] = "只显示图标"; + Text[ russian ] = " "; + Text[ polish ] = "Tylko symbole"; + Text[ japanese ] = "データポイントのみ"; + Text[ chinese_traditional ] = "只允許圖示"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "기호만"; + Text[ turkish ] = "Yalnzca simge"; + Text[ catalan ] = "Noms smbols"; + Text[ finnish ] = "Vain symbolit"; + Text[ thai ] = "สัญลักษณ์อย่างเดียว"; + Text[ czech ] = "Pouze symboly"; + Text[ hebrew ] = "Nur Symbole"; + Text[ hindi ] = "केवल संकेत"; + Text[ slovak ] = "Iba symboly"; +}; +String STR_ONLY_LINES +{ + Text = "Nur Linien" ; + Text [ ENGLISH ] = "Only lines" ; + Text [ english_us ] = "Lines Only" ; + Text [ dutch ] = "Alleen lijnen" ; + Text [ italian ] = "Solo linee" ; + Text [ spanish ] = "Slo lneas" ; + Text [ french ] = "Uniquement lignes" ; + Text [ swedish ] = "Endast linjer" ; + Text [ danish ] = "Kun linjer" ; + Text [ portuguese ] = "S linhas" ; + Text [ portuguese_brazilian ] = "Somente Linhas" ; + Text[ chinese_simplified ] = "只显示线条"; + Text[ russian ] = " "; + Text[ polish ] = "Tylko linie"; + Text[ japanese ] = "線のみ"; + Text[ chinese_traditional ] = "只允許線條"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "선 만"; + Text[ turkish ] = "Yalnzca izgi"; + Text[ catalan ] = "Noms lnies"; + Text[ finnish ] = "Vain viivat"; + Text[ thai ] = "บรรทัดอย่างเดียว"; + Text[ czech ] = "Pouze čáry"; + Text[ hebrew ] = "Nur Linien"; + Text[ hindi ] = "Lines Only"; + Text[ slovak ] = "Iba čiary"; +}; +String STR_LINE_SYMBOLS +{ + Text = "Linien mit Symbolen" ; + Text [ ENGLISH ] = "Lines with symbols" ; + Text [ english_us ] = "Lines with Symbols" ; + Text [ dutch ] = "Lijnen met symbolen" ; + Text [ italian ] = "Linee con simboli" ; + Text [ spanish ] = "Lneas con smbolos" ; + Text [ french ] = "Lignes avec symboles" ; + Text [ swedish ] = "Linjer med symboler" ; + Text [ danish ] = "Linjer med mrker" ; + Text [ portuguese ] = "Linhas com smbolos" ; + Text [ portuguese_brazilian ] = "Linhas com Smbolos" ; + Text[ chinese_simplified ] = "带图标的线条"; + Text[ russian ] = " "; + Text[ polish ] = "Linie z symbolami"; + Text[ japanese ] = "データポイント付き折れ線"; + Text[ chinese_traditional ] = "圖示線條"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "기호가 포함된 선"; + Text[ turkish ] = "Simgeli izgi"; + Text[ catalan ] = "Lnies amb smbols"; + Text[ finnish ] = "Viivat ja symbolit"; + Text[ thai ] = "บรรทัดกับสัญลักษณ์"; + Text[ czech ] = "Čáry se symboly"; + Text[ hebrew ] = "Linien mit Symbolen"; + Text[ hindi ] = "संकेतों सहित रेखाएँ"; + Text[ slovak ] = "Čiary so symbolmi"; +}; + +String STR_LINE_COLUMN +{ + Text = "Verbunddiagramm: Linie und Sulen" ; + Text [ ENGLISH ] = "Combination chart: Line and Columns" ; + Text [ english_us ] = "Combination Chart: Lines and Columns" ; + Text [ portuguese ] = "Grfico combinado: linhas e colunas" ; + Text [ portuguese_brazilian ] = "Grfico Combinado: Linhas e Colunas" ; + Text [ swedish ] = "Kombinationsdiagram: linjer och staplar" ; + Text [ danish ] = "Kombinationsdiagram: Linjer og sjler" ; + Text [ italian ] = "Diagramma combinato: linee e colonne" ; + Text [ spanish ] = "Diagrama combinado: Lneas y columnas" ; + Text [ french ] = "Diagramme combin : lignes et colonnes" ; + Text [ dutch ] = "Combinatiediagram: lijnen en zuilen" ; + Text[ chinese_simplified ] = "组合图表:线条和柱"; + Text[ russian ] = " : "; + Text[ polish ] = "Wykres zoony: Linie i supki"; + Text[ japanese ] = "組み合わせ:折れ線と縦棒"; + Text[ chinese_traditional ] = "連結圖表:線條和柱形"; + Text[ arabic ] = " : "; + Text[ greek ] = " : "; + Text[ korean ] = "조합 차트: 선과 열"; + Text[ turkish ] = "Karma ema: izgi ve stunlar"; + Text[ catalan ] = "Diagrama combinat: Lnies i columnes"; + Text[ finnish ] = "Yhdistelmkaavio: Rivit ja sarakkeet"; + Text[ thai ] = "เชื่อมแผนภูมิ: บรรทัดและคอลัมน์์"; + Text[ czech ] = "Kombinovaný graf: řádky a sloupce"; + Text[ hebrew ] = "Verbunddiagramm: Linie und Säulen"; + Text[ hindi ] = "Combination Chart: Lines and Columns"; + Text[ slovak ] = "Kombinovaný graf: čiary a stĺpce"; +}; +String STR_LINE_STACKEDCOLUMN +{ + Text = "Verbunddiagramm: Linie und gestapelte Sulen" ; + Text [ ENGLISH ] = "Verbunddiagramm: Linie und gestapelte Sulen" ; + Text [ english_us ] = "Combination Chart: Lines and stacked columns" ; + Text [ portuguese ] = "Grfico combinado: linha e colunas sobrepostas" ; + Text [ portuguese_brazilian ] = "Grfico Combinado: Linha e colunas empilhadas" ; + Text [ swedish ] = "Kombinationsdiagram: linjer och staplade staplar" ; + Text [ danish ] = "Kombinationsdiagram: Linjer og stablede sjler" ; + Text [ italian ] = "Diagramma composto: linea e colonne impilate" ; + Text [ spanish ] = "Diagrama combinado: Lnea y columnas sobrepuestas" ; + Text [ french ] = "Diagramme combin : lignes et colonnes empiles" ; + Text [ dutch ] = "Combinatiediagram: lijn en gestapelde zuilen" ; + Text[ chinese_simplified ] = "组合图表:线条和重叠柱"; + Text[ russian ] = " : "; + Text[ polish ] = "Wykres zoony: Linie i supki skumulowane"; + Text[ japanese ] = "組み合わせ:線と積み上げ縦棒"; + Text[ chinese_traditional ] = "連結圖表:線條和重疊柱"; + Text[ arabic ] = " : "; + Text[ greek ] = " : "; + Text[ korean ] = "조합 차트: 선과 누적된 열"; + Text[ turkish ] = "Karma ema: izgi ve ylm stunlar"; + Text[ catalan ] = "Diagrama combinat: Lnia i columnes superposades"; + Text[ finnish ] = "Yhdistelmkaavio: Rivit ja pinotut sarakkeet"; + Text[ thai ] = "เชื่อมแผนภูมิ: บรรทัดและคอลัมน์์แบบกองซ้อน"; + Text[ czech ] = "Kombinovaný graf: řádky a skládané sloupce"; + Text[ hebrew ] = "Verbunddiagramm: Linie und gestapelte Säulen"; + Text[ hindi ] = "Combination Chart: Lines and stacked columns"; + Text[ slovak ] = "Kombinovaný graf: čiary a skladané stĺpce"; +}; +String STR_NET +{ + Text = "Netz" ; + Text [ ENGLISH ] = "Net" ; + Text [ english_us ] = "Net" ; + Text [ italian ] = "Rete" ; + Text [ spanish ] = "Red" ; + Text [ french ] = "Toile" ; + Text [ dutch ] = "Net" ; + Text [ swedish ] = "Polr" ; + Text [ danish ] = "Radar" ; + Text [ portuguese ] = "Rede" ; + Text [ portuguese_brazilian ] = "Rede" ; + Text[ chinese_simplified ] = "网络"; + Text[ russian ] = ""; + Text[ polish ] = "Sie"; + Text[ japanese ] = "レーダー網"; + Text[ chinese_traditional ] = "網路"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "네트워크"; + Text[ turkish ] = "A"; + Text[ catalan ] = "Xarxa"; + Text[ finnish ] = "Verkko"; + Text[ thai ] = "เครือข่าย"; + Text[ czech ] = "Síť"; + Text[ hebrew ] = "Netz"; + Text[ hindi ] = "नेट्"; + Text[ slovak ] = "Sieťový graf"; +}; +String STR_SYMBOL +{ + Text = "Symbole" ; + Text [ ENGLISH ] = "Net with symbols" ; + Text [ english_us ] = "Symbols" ; + Text [ dutch ] = "Symbolen" ; + Text [ italian ] = "Simboli" ; + Text [ spanish ] = "Smbolos" ; + Text [ french ] = "Symboles" ; + Text [ swedish ] = "Symboler" ; + Text [ danish ] = "Mrker" ; + Text [ portuguese ] = "Smbolos" ; + Text [ portuguese_brazilian ] = "Smbolos" ; + Text[ chinese_simplified ] = "图标"; + Text[ russian ] = ""; + Text[ polish ] = "Symbole"; + Text[ japanese ] = "データポイント"; + Text[ chinese_traditional ] = "圖示"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "기호"; + Text[ turkish ] = "Simge"; + Text[ catalan ] = "Smbols"; + Text[ finnish ] = "Symbolit"; + Text[ thai ] = "สัญลักษณ์"; + Text[ czech ] = "Symboly"; + Text[ hebrew ] = "Symbole"; + Text[ hindi ] = "संकेत"; + Text[ slovak ] = "Symbolový graf"; +}; + +String STR_SYMBOL_STACK +{ + Text = "Gestapelt mit Symbolen" ; + Text [ ENGLISH ] = "Stacked net with symbols" ; + Text [ english_us ] = "Stacked with symbols" ; + Text [ italian ] = "Sovrapposto con simboli" ; + Text [ spanish ] = "Apilado con smbolos" ; + Text [ french ] = "Empil avec symboles" ; + Text [ dutch ] = "Gestapeld met symbolen" ; + Text [ swedish ] = "Staplade med symboler" ; + Text [ danish ] = "Stablet med mrker" ; + Text [ portuguese ] = "Empilhado com smbolos" ; + Text [ portuguese_brazilian ] = "Empilhado com smbolos" ; + Text[ chinese_simplified ] = "重叠图标"; + Text[ russian ] = " "; + Text[ polish ] = "Skumulowany z symbolami"; + Text[ japanese ] = "データポイント付き積み上げ"; + Text[ chinese_traditional ] = "重疊圖示"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "기호 누적"; + Text[ turkish ] = "Simgeli ylm"; + Text[ catalan ] = "Apilat amb smbols"; + Text[ finnish ] = "Pinottu ja symbolit"; + Text[ thai ] = "กองซ้อนด้วยสัญลักษณ์"; + Text[ czech ] = "Skládaný se symboly"; + Text[ hebrew ] = "Gestapelt mit Symbolen"; + Text[ hindi ] = "Stacked with symbols"; + Text[ slovak ] = "Skladaný graf so symbolmi"; +}; +String STR_SYMBOL_PERCENT +{ + Text = "Prozentual mit Symbolen" ; + Text [ ENGLISH ] = "Percentage net with symbols" ; + Text [ dutch ] = "Procentueel met symbolen" ; + Text [ english_us ] = "Percent with symbols" ; + Text [ italian ] = "Percentuale con simboli" ; + Text [ spanish ] = "Porcentual con smbolos" ; + Text [ french ] = "Pourcentage avec symboles" ; + Text [ swedish ] = "Procentuellt med symboler" ; + Text [ danish ] = "Procent med mrker" ; + Text [ portuguese ] = "Percentagem com smbolos" ; + Text [ portuguese_brazilian ] = "Percentagem com smbolos" ; + Text[ chinese_simplified ] = "百分比图标"; + Text[ russian ] = " "; + Text[ polish ] = "Procentowy z symbolami"; + Text[ japanese ] = "データポイント付きパーセント"; + Text[ chinese_traditional ] = "圖示百分比"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "기호 포함 백분율"; + Text[ turkish ] = "Simgeli yzde"; + Text[ catalan ] = "Percentual amb smbols"; + Text[ finnish ] = "Prosenttiarvo ja symbolit"; + Text[ thai ] = "เปอร์เซ็นต์กับสัญลักษณ์"; + Text[ czech ] = "Procentuální se symboly"; + Text[ hebrew ] = "Prozentual mit Symbolen"; + Text[ hindi ] = "Percent with symbols"; + Text[ slovak ] = "Percentuálny graf so symbolmi"; +}; + +String STR_SPLINE_CUBIC +{ + Text = "Kubischer Spline" ; + Text [ ENGLISH ] = "Cubic spline" ; + Text [ english_us ] = "Cubic Spline" ; + Text [ italian ] = "Spline cubico" ; + Text [ spanish ] = "Spline cbico" ; + Text [ french ] = "Spline cubique" ; + Text [ dutch ] = "Kubieke spline" ; + Text [ swedish ] = "Kubisk spline" ; + Text [ danish ] = "Kubisk spline" ; + Text [ portuguese ] = "Spline cbico" ; + Text [ portuguese_brazilian ] = "Spline Cbico" ; + Text[ chinese_simplified ] = "立方样条"; + Text[ russian ] = " "; + Text[ polish ] = "Kubiczna krzywa skadana"; + Text[ japanese ] = "データポイントなしスプライン"; + Text[ chinese_traditional ] = "立方形齒條"; + Text[ arabic ] = "Spline "; + Text[ greek ] = "Spline "; + Text[ korean ] = "입체 스플라인"; + Text[ turkish ] = "Kbik spline"; + Text[ catalan ] = "Spline cbic"; + Text[ finnish ] = "Kuutiosplini"; + Text[ thai ] = "เครื่องสลักลูกบาศก์"; + Text[ czech ] = "Kubický splajn"; + Text[ hebrew ] = "Kubischer Spline"; + Text[ hindi ] = "घन स्प्लइन"; + Text[ slovak ] = "Kubický splajn"; +}; +String STR_SPLINE_CUBIC_SYMBOL +{ + Text = "Kubischer Spline mit Symbolen" ; + Text [ ENGLISH ] = "Cubic spline with symbols" ; + Text [ english_us ] = "Cubic Spline with Symbols" ; + Text [ italian ] = "Spline cubico con simboli" ; + Text [ spanish ] = "Spline cbico con smbolos" ; + Text [ french ] = "Spline cubique avec symboles" ; + Text [ dutch ] = "Kubieke spline met symbolen" ; + Text [ swedish ] = "Kubisk spline med symboler" ; + Text [ danish ] = "Kubisk spline med mrker" ; + Text [ portuguese ] = "Spline cbico com smbolos" ; + Text [ portuguese_brazilian ] = "Spline Cbico com Smbolos" ; + Text[ chinese_simplified ] = "带图标的立方样条"; + Text[ russian ] = " "; + Text[ polish ] = "Kubiczna krzywa skadana z symbolami"; + Text[ japanese ] = "データポイント付きスプライン"; + Text[ chinese_traditional ] = "圖示立方形齒條"; + Text[ arabic ] = "Spline "; + Text[ greek ] = "Spline "; + Text[ korean ] = "입체 스프라인 기호 포함"; + Text[ turkish ] = "Simgeli kbik spline"; + Text[ catalan ] = "Spline cbic amb smbols"; + Text[ finnish ] = "Kuutiosplini ja symbolit"; + Text[ thai ] = "สลักลูกบาศก์ด้วยสัญลักษณ์"; + Text[ czech ] = "Kubický splajn se symboly"; + Text[ hebrew ] = "Kubischer Spline mit Symbolen"; + Text[ hindi ] = "संकेतों सहित घन स्प्लइन"; + Text[ slovak ] = "Kubický splajn so symbolmi"; +}; +String STR_SPLINE_B +{ + Text = "B-Spline" ; + Text [ ENGLISH ] = "B-spline" ; + Text [ dutch ] = "B-spline" ; + Text [ english_us ] = "B-Spline" ; + Text [ italian ] = "B-Spline" ; + Text [ spanish ] = "B spline" ; + Text [ french ] = "Spline B" ; + Text [ swedish ] = "B-spline" ; + Text [ danish ] = "B-spline" ; + Text [ portuguese ] = "B-Spline" ; + Text [ portuguese_brazilian ] = "Spline B" ; + Text[ chinese_simplified ] = "B 样条"; + Text[ russian ] = "B-"; + Text[ polish ] = "Krzywa skadana B"; + Text[ japanese ] = "B スプライン"; + Text[ chinese_traditional ] = "B-齒條"; + Text[ arabic ] = "B-Spline"; + Text[ greek ] = "B-Spline"; + Text[ korean ] = "B-스플라인"; + Text[ turkish ] = "B-Spline"; + Text[ catalan ] = "B-Spline"; + Text[ finnish ] = "B-splini"; + Text[ thai ] = "B-Spline"; + Text[ czech ] = "B-splajn"; + Text[ hebrew ] = "B-Spline"; + Text[ hindi ] = "B-स्प्लइन"; + Text[ slovak ] = "B-splajn"; +}; +String STR_SPLINE_B_SYMBOL +{ + Text = "B-Spline mit Symbolen" ; + Text [ ENGLISH ] = "B-spline with symbols" ; + Text [ english_us ] = "B-Spline with Symbols" ; + Text [ italian ] = "B-Spline con simboli" ; + Text [ spanish ] = "B spline con smbolos" ; + Text [ french ] = "Spline B avec symboles" ; + Text [ dutch ] = "B-spline met symbolen" ; + Text [ swedish ] = "B-spline med symboler" ; + Text [ danish ] = "B-spline med mrker" ; + Text [ portuguese ] = "Spline B com smbolos" ; + Text [ portuguese_brazilian ] = "Spline B com Smbolos" ; + Text[ chinese_simplified ] = "带图标的 B 立方样条"; + Text[ russian ] = "B- "; + Text[ polish ] = "Krzywa skadana B z symbolami"; + Text[ japanese ] = "データポイント付きBスプライン"; + Text[ chinese_traditional ] = "圖示 B-齒條"; + Text[ arabic ] = "B-Spline "; + Text[ greek ] = "B-Spline "; + Text[ korean ] = "기호 포함한 B-스플라인"; + Text[ turkish ] = "Simgeli B-Spline"; + Text[ catalan ] = "B spline amb smbols"; + Text[ finnish ] = "B-splini ja symbolit"; + Text[ thai ] = "B-Splineด้วยสัญลักษณ์"; + Text[ czech ] = "B-splajn se symboly"; + Text[ hebrew ] = "B-Spline mit Symbolen"; + Text[ hindi ] = "संकेतों सहित B-स्प्लइन "; + Text[ slovak ] = "B-splajn so symbolmi"; +}; + +String STR_STOCK +{ + Text = "Kursdiagramm" ; + Text [ ENGLISH ] = "stock chart" ; + Text[ italian ] = "diagramma quotazioni"; + Text[ portuguese_brazilian ] = "Grfico de cotaes"; + Text[ portuguese ] = "Grfico de cotaes"; + Text[ danish ] = "Aktiediagram"; + Text[ french ] = "Diagramme des cours"; + Text[ swedish ] = "Kursdiagram"; + Text[ dutch ] = "Koersdiagram"; + Text[ spanish ] = "Diagrama de curso"; + Text[ english_us ] = "Stock Chart"; + Text[ chinese_simplified ] = "股票图表"; + Text[ russian ] = " "; + Text[ polish ] = "Wykres giedowy"; + Text[ japanese ] = "株価チャート"; + Text[ chinese_traditional ] = "股票圖表"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "주가 차트"; + Text[ turkish ] = "Hisse senedi grafii"; + Text[ catalan ] = "Diagrama de borsa"; + Text[ finnish ] = "Prssikaavio"; + Text[ thai ] = "แผนภูมิหุ้น"; + Text[ czech ] = "Burzovní graf"; + Text[ hebrew ] = "Kursdiagramm"; + Text[ hindi ] = "संचय चार्ट"; + Text[ slovak ] = "Burzový graf"; +}; +String STR_STOCK_1 +{ + Text = "Kursdiagramm 1" ; + Text [ ENGLISH ] = "stock chart 1" ; + Text[ italian ] = "diagramma quotazioni 1"; + Text[ portuguese_brazilian ] = "Grfico de cotaes 1"; + Text[ portuguese ] = "Grfico de cotaes 1"; + Text[ danish ] = "Aktiediagram 1"; + Text[ french ] = "Diagramme des cours 1"; + Text[ swedish ] = "Kursdiagram 1"; + Text[ dutch ] = "Koersdiagram 1"; + Text[ spanish ] = "Diagrama de curso 1"; + Text[ english_us ] = "Stock Chart 1"; + Text[ chinese_simplified ] = "股票图表 1"; + Text[ russian ] = " 1"; + Text[ polish ] = "Wykres giedowy 1"; + Text[ japanese ] = "株価チャート 1"; + Text[ chinese_traditional ] = "股票圖表 1"; + Text[ arabic ] = " "; + Text[ greek ] = " 1"; + Text[ korean ] = "주가 차트 1"; + Text[ turkish ] = "Hisse senedi grafii 1"; + Text[ catalan ] = "Diagrama de borsa 1"; + Text[ finnish ] = "Prssikaavio 1"; + Text[ thai ] = "แผนภูมิหุ้น 1"; + Text[ czech ] = "Burzovní graf 1"; + Text[ hebrew ] = "Kursdiagramm 1"; + Text[ hindi ] = "संचय चार्ट 1 "; + Text[ slovak ] = "Burzový graf 1"; +}; +String STR_STOCK_2 +{ + Text = "Kursdiagramm 2" ; + Text [ ENGLISH ] = "stock chart 2" ; + Text[ italian ] = "diagramma quotazioni 2"; + Text[ portuguese_brazilian ] = "Grfico de cotaes 2"; + Text[ portuguese ] = "Grfico de cotaes 2"; + Text[ danish ] = "Aktiediagram 2"; + Text[ french ] = "Diagramme des cours 2"; + Text[ swedish ] = "Kursdiagram 2"; + Text[ dutch ] = "Koersdiagram 2"; + Text[ spanish ] = "Diagrama de curso 2"; + Text[ english_us ] = "Stock Chart 2"; + Text[ chinese_simplified ] = "股票图表 2"; + Text[ russian ] = " 2"; + Text[ polish ] = "Wykres giedowy 2"; + Text[ japanese ] = "株価チャート 2"; + Text[ chinese_traditional ] = "股票圖表 2"; + Text[ arabic ] = " "; + Text[ greek ] = " 2"; + Text[ korean ] = "주가 차트 2"; + Text[ turkish ] = "Hisse senedi grafii 2"; + Text[ catalan ] = "Diagrama de borsa 2"; + Text[ finnish ] = "Prssikaavio 2"; + Text[ thai ] = "แผนภูมิหุ้น 2"; + Text[ czech ] = "Burzovní graf 2"; + Text[ hebrew ] = "Kursdiagramm 2"; + Text[ hindi ] = "संचय चार्ट 2"; + Text[ slovak ] = "Burzový graf 2"; +}; +String STR_STOCK_3 +{ + Text = "Kursdiagramm 3" ; + Text [ ENGLISH ] = "stock chart 3" ; + Text[ italian ] = "diagramma quotazioni 3"; + Text[ portuguese_brazilian ] = "Grfico de cotaes 3"; + Text[ portuguese ] = "Grfico de cotaes 3"; + Text[ danish ] = "Aktiediagram 3"; + Text[ french ] = "Diagramme des cours 3"; + Text[ swedish ] = "Kursdiagram 3"; + Text[ dutch ] = "Koersdiagram 3"; + Text[ spanish ] = "Diagrama de curso 3"; + Text[ english_us ] = "Stock Chart 3"; + Text[ chinese_simplified ] = "股票图表 3"; + Text[ russian ] = " 3"; + Text[ polish ] = "Wykres giedowy 3"; + Text[ japanese ] = "株価チャート 3"; + Text[ chinese_traditional ] = "股票圖表 3"; + Text[ arabic ] = " "; + Text[ greek ] = " 3"; + Text[ korean ] = "주가 차트 3"; + Text[ turkish ] = "Hisse senedi grafii 3"; + Text[ catalan ] = "Diagrama de borsa 3"; + Text[ finnish ] = "Prssikaavio 3"; + Text[ thai ] = "แผนภูมิหุ้น 3"; + Text[ czech ] = "Burzovní graf 3"; + Text[ hebrew ] = "Kursdiagramm 3"; + Text[ hindi ] = "संचय चार्ट 3"; + Text[ slovak ] = "Burzový graf 3"; +}; +String STR_STOCK_4 +{ + Text = "Kursdiagramm 4" ; + Text [ ENGLISH ] = "stock chart 4" ; + Text[ italian ] = "diagramma quotazioni 4"; + Text[ portuguese_brazilian ] = "Grfico de cotaes 4"; + Text[ portuguese ] = "Grfico de cotaes 4"; + Text[ danish ] = "Aktiediagram 4"; + Text[ french ] = "Diagramme des cours 4"; + Text[ swedish ] = "Kursdiagram 4"; + Text[ dutch ] = "Koersdiagram 4"; + Text[ spanish ] = "Diagrama de curso 4"; + Text[ english_us ] = "Stock Chart 4"; + Text[ chinese_simplified ] = "股票图表 4"; + Text[ russian ] = " 4"; + Text[ polish ] = "Wykres giedowy 4"; + Text[ japanese ] = "株価チャート 4"; + Text[ chinese_traditional ] = "股票圖表 4"; + Text[ arabic ] = " "; + Text[ greek ] = " 4"; + Text[ korean ] = "주가 차트 4"; + Text[ turkish ] = "Hisse senedi grafii 4"; + Text[ catalan ] = "Diagrama de borsa 4"; + Text[ finnish ] = "Prssikaavio 4"; + Text[ thai ] = "แผนภูมิหุ้น 4"; + Text[ czech ] = "Burzovní graf 4"; + Text[ hebrew ] = "Kursdiagramm 4"; + Text[ hindi ] = "संचय चार्ट 4"; + Text[ slovak ] = "Burzový graf 4"; +}; + +//----------------------------------- +String STR_SAEULE_3D_1 +{ + Text = "Runde Sulen" ; + Text[ ENGLISH ] = "Cylinder"; + Text[ italian ] = "Colonne rotonde" ; + Text[ french ] = "Colonnes arrondies" ; + Text[ english_us ] = "Cylinder"; + Text[ portuguese ] = "Colunas redondas"; + Text[ russian ] = ""; + Text[ dutch ] = "cilinders"; + Text[ spanish ] = "Columnas redondas"; + Text[ danish ] = "Cylindre"; + Text[ swedish ] = "Runda pelare"; + Text[ polish ] = "Okrge supki"; + Text[ portuguese_brazilian ] = "Cilindro"; + Text[ japanese ] = "円柱"; + Text[ chinese_simplified ] = "圆柱体"; + Text[ chinese_traditional ] = "圓柱"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "실린더"; + Text[ turkish ] = "Silindir"; + Text[ catalan ] = "Cilindre"; + Text[ finnish ] = "Lieri"; + Text[ thai ] = "ทรงกระบอก"; + Text[ czech ] = "Válec"; + Text[ hebrew ] = "Runde Säulen"; + Text[ hindi ] = "बेलन"; + Text[ slovak ] = "Valec"; +}; +String STR_SAEULE_3D_2 +{ + Text = "Runde, gestapelte Sulen" ; + Text[ ENGLISH ] = "Cylinder, stacked"; + Text[ italian ] = "Colonne rotonde sovrapposte" ; + Text[ french ] = "Colonnes arrondies empiles" ; + Text[ english_us ] = "Cylinder, stacked"; + Text[ portuguese ] = "Barras redondas sobrepostas"; + Text[ russian ] = ", "; + Text[ dutch ] = "cilinders, gestapeld"; + Text[ spanish ] = "Columnas redondas apiladas"; + Text[ danish ] = "Stablede cylindre"; + Text[ swedish ] = "Runda, staplade pelare"; + Text[ polish ] = "Okrge supki skumulowane"; + Text[ portuguese_brazilian ] = "Cilindro, empilhado"; + Text[ japanese ] = "積み上げ円柱"; + Text[ chinese_simplified ] = "堆积型圆柱体"; + Text[ chinese_traditional ] = "重疊圓柱"; + Text[ arabic ] = " "; + Text[ greek ] = ", "; + Text[ korean ] = "쌓아 올린 실린더"; + Text[ turkish ] = "Ylm silindir"; + Text[ catalan ] = "Cilindre, apilat"; + Text[ finnish ] = "Lieri, pllekkiset"; + Text[ thai ] = "ทรงกระบอก, กองซ้อน"; + Text[ czech ] = "Válec, skládaný"; + Text[ hebrew ] = "Runde, gestapelte Säulen"; + Text[ hindi ] = "बेलन, स्टॉक की हुयी"; + Text[ slovak ] = "Valec, skladaný"; +}; +String STR_SAEULE_3D_3 +{ + Text = "Runde Sulen, Prozent"; + Text[ ENGLISH ] = "Cylinder, percent"; + Text[ italian ] = "Colonne rotonde, percentuale"; + Text[ french ] = "Colonnes arrondies, pourcentage"; + Text[ english_us ] = "Cylinder, percent"; + Text[ portuguese ] = "Colunas redondas, percentuais"; + Text[ russian ] = ", "; + Text[ dutch ] = "cilinders, procent"; + Text[ spanish ] = "Columnas redondas, porciento"; + Text[ danish ] = "Cylindre, procent"; + Text[ swedish ] = "Runda pelare, procent"; + Text[ polish ] = "Okrge supki procentowe"; + Text[ portuguese_brazilian ] = "Cilindro, percentual"; + Text[ japanese ] = "円柱、パーセント"; + Text[ chinese_simplified ] = "百分比圆柱体"; + Text[ chinese_traditional ] = "百分比圓柱"; + Text[ arabic ] = " "; + Text[ greek ] = ", (%)"; + Text[ korean ] = "실린더, 백분율"; + Text[ turkish ] = "Silindir, yzde"; + Text[ catalan ] = "Cilindre, percentatge"; + Text[ finnish ] = "Lieri, prosentti"; + Text[ thai ] = "ทรงกระบอก, เปอร์เซ็นต์"; + Text[ czech ] = "Válec, procenta"; + Text[ hebrew ] = "Runde Säulen, Prozent"; + Text[ hindi ] = "Cylinder, percent"; + Text[ slovak ] = "Valec, percentuálny"; +}; +String STR_SAEULE_3D_4 +{ + Text = "Runde Sulen, Tief" ; + Text[ ENGLISH ] = "Cylinder, deep"; + Text[ italian ] = "Colonne rontonde, in basso" ; + Text[ french ] = "Colonnes arrondies, en profondeur" ; + Text[ english_us ] = "Cylinder, deep"; + Text[ portuguese ] = "Colunas redondas, com profundidade"; + Text[ russian ] = ", "; + Text[ dutch ] = "cilinders, met diepte"; + Text[ spanish ] = "Columnas redondas, en profundidad"; + Text[ danish ] = "Cylindre, dyb"; + Text[ swedish ] = "Runda pelare, djupa"; + Text[ polish ] = "Okrge supki przestrzenne"; + Text[ portuguese_brazilian ] = "Cilindro, com profundidade"; + Text[ japanese ] = "円柱、奥行きあり"; + Text[ chinese_simplified ] = "带深度的圆柱体"; + Text[ chinese_traditional ] = "深向圓柱"; + Text[ arabic ] = " "; + Text[ greek ] = ", "; + Text[ korean ] = "실린더, 깊이"; + Text[ turkish ] = "Silindir, derin"; + Text[ catalan ] = "Cilindre, profunditat"; + Text[ finnish ] = "Lieri, syv"; + Text[ thai ] = "ทรงกระบอก, ลึก"; + Text[ czech ] = "Válec, hloubka"; + Text[ hebrew ] = "Runde Säulen, Tief"; + Text[ hindi ] = "बेलन, गहरा"; + Text[ slovak ] = "Valec, do hĺbky"; +}; +//----------------------------------- +String STR_ROEHRE_3D_1 +{ + Text = "Rhren" ; + Text[ ENGLISH ] = "Tubes"; + Text[ italian ] = "Tubi" ; + Text[ french ] = "Tubes" ; + Text[ english_us ] = "Tubes"; + Text[ portuguese ] = "Tubos"; + Text[ russian ] = ""; + Text[ dutch ] = "horizontale cilinders"; + Text[ spanish ] = "Tubos"; + Text[ danish ] = "Rr"; + Text[ swedish ] = "Rr"; + Text[ polish ] = "Rurki"; + Text[ portuguese_brazilian ] = "Tubos"; + Text[ japanese ] = "円筒"; + Text[ chinese_simplified ] = "管道"; + Text[ chinese_traditional ] = "管形"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "관"; + Text[ turkish ] = "Tp"; + Text[ catalan ] = "Tubs"; + Text[ finnish ] = "Putket"; + Text[ thai ] = "ท่อ"; + Text[ czech ] = "Trubky"; + Text[ hebrew ] = "Röhren"; + Text[ hindi ] = "नालियाँ"; + Text[ slovak ] = "Trúbky"; +}; +String STR_ROEHRE_3D_2 +{ + Text = "Gestapelte Rhren" ; + Text[ ENGLISH ] = "Tubes, stacked"; + Text[ italian ] = "Tubi sovrapposti" ; + Text[ french ] = "Tubes empils" ; + Text[ english_us ] = "Tubes, stacked"; + Text[ portuguese ] = "Tubos, sobrepostos"; + Text[ russian ] = ", "; + Text[ dutch ] = "horizontale cilinders, gestapeld"; + Text[ spanish ] = "Tubos apilados"; + Text[ danish ] = "Stablede rr"; + Text[ swedish ] = "Rr, staplade"; + Text[ polish ] = "Rurki skumulowane"; + Text[ portuguese_brazilian ] = "Tubos, empilhados"; + Text[ japanese ] = "積み上げ円筒"; + Text[ chinese_simplified ] = "堆积型管道"; + Text[ chinese_traditional ] = "重疊管形"; + Text[ arabic ] = " "; + Text[ greek ] = ", "; + Text[ korean ] = "파이프, 누적"; + Text[ turkish ] = "Ylm tpler"; + Text[ catalan ] = "Tubs, apilats"; + Text[ finnish ] = "Putket, pinottuja"; + Text[ thai ] = "ท่อ, กองซ้อน"; + Text[ czech ] = "Trubky, skládané"; + Text[ hebrew ] = "Gestapelte Röhren"; + Text[ hindi ] = "नालियाँ, स्टॉक की हुयी"; + Text[ slovak ] = "Trúbky, skladané"; +}; +String STR_ROEHRE_3D_3 +{ + Text = "Rhren, Prozent"; + Text[ ENGLISH ] = "Tubes, percent"; + Text[ italian ] = "Tubi, percentuale"; + Text[ french ] = "Tubes, pourcentage"; + Text[ english_us ] = "Tubes, percent"; + Text[ portuguese ] = "Tubos, percentuais"; + Text[ russian ] = ", "; + Text[ dutch ] = "horizontale cilinders, procent"; + Text[ spanish ] = "Tubos, porciento"; + Text[ danish ] = "Rr, procent"; + Text[ swedish ] = "Rr, procent"; + Text[ polish ] = "Rurki procentowe"; + Text[ portuguese_brazilian ] = "Tubos, percentuais"; + Text[ japanese ] = "円筒、パーセント"; + Text[ chinese_simplified ] = "百分比管道"; + Text[ chinese_traditional ] = "百分比管形"; + Text[ arabic ] = " "; + Text[ greek ] = ", (%)"; + Text[ korean ] = "관, 백분율"; + Text[ turkish ] = "Tp, yzde"; + Text[ catalan ] = "Tubs, percentatge"; + Text[ finnish ] = "Putket, prosenttia"; + Text[ thai ] = "ท่อ, เปอร์เซ็นต์"; + Text[ czech ] = "Trubky, procenta"; + Text[ hebrew ] = "Röhren, Prozent"; + Text[ hindi ] = "नालियाँ, प्रतिशत"; + Text[ slovak ] = "Trúbky, percentuálne"; +}; +String STR_ROEHRE_3D_4 +{ + Text = "Rhren, Tief" ; + Text[ ENGLISH ] = "Tubes, deep"; + Text[ italian ] = "Tubi, in basso" ; + Text[ french ] = "Tubes, en profondeur" ; + Text[ english_us ] = "Tubes, deep"; + Text[ portuguese ] = "Tubos, com profundidade"; + Text[ russian ] = ", "; + Text[ dutch ] = "horizontale cilinders, met diepte"; + Text[ spanish ] = "Tubos, en profundidad"; + Text[ danish ] = "Rr, dyb"; + Text[ swedish ] = "Rr, djupa"; + Text[ polish ] = "Rurki przestrzenne"; + Text[ portuguese_brazilian ] = "Tubos, com profundidade"; + Text[ japanese ] = "円筒、奥行きあり"; + Text[ chinese_simplified ] = "带深度的管道"; + Text[ chinese_traditional ] = "深向管形"; + Text[ arabic ] = " "; + Text[ greek ] = ", "; + Text[ korean ] = "관, 깊이"; + Text[ turkish ] = "Tp, derin"; + Text[ catalan ] = "Tubs, profunditat"; + Text[ finnish ] = "Putket, syvt"; + Text[ thai ] = "ท่อ, ลึก"; + Text[ czech ] = "Trubky, hloubka"; + Text[ hebrew ] = "Röhren, Tief"; + Text[ hindi ] = "नालियाँ, गहरा"; + Text[ slovak ] = "Trúbky, do hĺbky"; +}; +String STR_PYRAMID_3D_1 +{ + Text = "Pyramiden" ; + Text[ ENGLISH ] = "Pyramids"; + Text[ italian ] = "Piramidi" ; + Text[ french ] = "Pyramides" ; + Text[ english_us ] = "Pyramids"; + Text[ portuguese ] = "Pirmides"; + Text[ russian ] = ""; + Text[ dutch ] = "Piramiden"; + Text[ spanish ] = "Pirmides"; + Text[ danish ] = "Pyramider"; + Text[ swedish ] = "Pyramider"; + Text[ polish ] = "Ostrosupowy"; + Text[ portuguese_brazilian ] = "Pirmides"; + Text[ japanese ] = "角錐"; + Text[ chinese_simplified ] = "棱锥体"; + Text[ chinese_traditional ] = "錐體"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "피라미드"; + Text[ turkish ] = "Piramit"; + Text[ catalan ] = "Pirmides"; + Text[ finnish ] = "Pyramidit"; + Text[ thai ] = "ปิรามิด"; + Text[ czech ] = "Jehlany"; + Text[ hebrew ] = "Pyramiden"; + Text[ hindi ] = "Pyramids"; + Text[ slovak ] = "Ihlany"; +}; +String STR_PYRAMID_3D_2 +{ + Text = "Gestapelte Pyramiden" ; + Text[ ENGLISH ] = "Pyramids, stacked"; + Text[ italian ] = "Piramidi sovrapposte" ; + Text[ french ] = "Pyramides empiles" ; + Text[ english_us ] = "Pyramids, stacked"; + Text[ portuguese ] = "Pirmides, sobrepostas"; + Text[ russian ] = ", "; + Text[ dutch ] = "Piramiden, gestapeld"; + Text[ spanish ] = "Pirmides apiladas"; + Text[ danish ] = "Stablede pyramider"; + Text[ swedish ] = "Staplade pyramider"; + Text[ polish ] = "Ostrosupy skumulowane"; + Text[ portuguese_brazilian ] = "Pirmides, empilhadas"; + Text[ japanese ] = "積み上げた角錐"; + Text[ chinese_simplified ] = "堆积型棱锥体"; + Text[ chinese_traditional ] = "重疊錐體"; + Text[ arabic ] = " "; + Text[ greek ] = ", "; + Text[ korean ] = "쌓아올린 피라미드"; + Text[ turkish ] = "Ylm piramitler"; + Text[ catalan ] = "Pirmides apilades"; + Text[ finnish ] = "Pyramidit, pinotut"; + Text[ thai ] = "ปิรามิด, กองซ้อน"; + Text[ czech ] = "Jehlany, skládané"; + Text[ hebrew ] = "Gestapelte Pyramiden"; + Text[ hindi ] = "सूच्याकार स्तंभ, स्टॉक किया हुआ"; + Text[ slovak ] = "Ihlany, skladané"; +}; +String STR_PYRAMID_3D_3 +{ + Text = "Pyramiden, Prozent"; + Text[ ENGLISH ] = "Pyramids percent"; + Text[ italian ] = "Piramidi, percentuale"; + Text[ french ] = "Pyramides, pourcentage"; + Text[ english_us ] = "Pyramids percent"; + Text[ portuguese ] = "Pirmides, percentuais"; + Text[ russian ] = ", "; + Text[ dutch ] = "Piramiden, procent"; + Text[ spanish ] = "Pirmides, porciento"; + Text[ danish ] = "Pyramider, procent"; + Text[ swedish ] = "Pyramider, procent"; + Text[ polish ] = "Ostrosupy procentowe"; + Text[ portuguese_brazilian ] = "Pirmides, percentuais"; + Text[ japanese ] = "角錐、パーセント"; + Text[ chinese_simplified ] = "百分比棱锥体"; + Text[ chinese_traditional ] = "百分比錐體"; + Text[ arabic ] = " "; + Text[ greek ] = ", (%)"; + Text[ korean ] = "피라미드 백분율"; + Text[ turkish ] = "Piramit, yzde"; + Text[ catalan ] = "Pirmides, percent"; + Text[ finnish ] = "Pyramidit prosentteina"; + Text[ thai ] = "เปอร์เซ็นต์ปิรามิด"; + Text[ czech ] = "Procenta jehlanu"; + Text[ hebrew ] = "Pyramiden, Prozent"; + Text[ hindi ] = "सूच्याकार स्तंभ प्रतिशत"; + Text[ slovak ] = "Ihlany, percentuálne"; +}; +String STR_PYRAMID_3D_4 +{ + Text = "Pyramiden, Tief" ; + Text[ ENGLISH ] = "Pyramids, deep"; + Text[ italian ] = "Piramidi, in basso" ; + Text[ french ] = "Pyramides, en profondeur" ; + Text[ english_us ] = "Pyramids, deep"; + Text[ portuguese ] = "Pirmides, com profundidade"; + Text[ russian ] = ", "; + Text[ dutch ] = "Piramiden, met diepte"; + Text[ spanish ] = "Pirmides, en profundidad"; + Text[ danish ] = "Pyramider, dyb"; + Text[ swedish ] = "Pyramider, djupa"; + Text[ polish ] = "Ostrosupy przestrzenne"; + Text[ portuguese_brazilian ] = "Pirmides, com profundidade"; + Text[ japanese ] = "角錐、奥行きあり"; + Text[ chinese_simplified ] = "带深度的棱锥体"; + Text[ chinese_traditional ] = "深向錐體"; + Text[ arabic ] = " "; + Text[ greek ] = ", "; + Text[ korean ] = "피라미드, 깊이"; + Text[ turkish ] = "Piramit, derin"; + Text[ catalan ] = "Pirmides, en profunditat"; + Text[ finnish ] = "Pyramidit, syvt"; + Text[ thai ] = "ปิรามิด, ลึก"; + Text[ czech ] = "Jehlany, hloubka"; + Text[ hebrew ] = "Pyramiden, Tief"; + Text[ hindi ] = "सूच्याकार स्तंभ, गहरा"; + Text[ slovak ] = "Ihlany, do hĺbky"; +}; +//----------------------------------- +String STR_PYRAMIDQ_3D_1 +{ + Text = "Horizontale Pyramiden" ; + Text[ ENGLISH ] = "Pyramids"; + Text[ italian ] = "Piramidi orizzontali" ; + Text[ french ] = "Pyramides horizontales" ; + Text[ english_us ] = "Horizontal pyramids"; + Text[ portuguese ] = "Pirmides horizontais"; + Text[ russian ] = " "; + Text[ dutch ] = "Horizontale piramiden"; + Text[ spanish ] = "Pirmides horizontales"; + Text[ danish ] = "Liggende pyramider"; + Text[ swedish ] = "Horisontala pyramider"; + Text[ polish ] = "Ostrosupy poziome"; + Text[ portuguese_brazilian ] = "Pirmides horizontais"; + Text[ japanese ] = "水平な角錐"; + Text[ chinese_simplified ] = "水平向棱锥体"; + Text[ chinese_traditional ] = "錐體"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "수평 피라미드"; + Text[ turkish ] = "Yatay piramit"; + Text[ catalan ] = "Pirmides horitzontals"; + Text[ finnish ] = "Vaakapyramidit"; + Text[ thai ] = "ปิรามิดแนวนอน"; + Text[ czech ] = "Vodorovné jehlany"; + Text[ hebrew ] = "Horizontale Pyramiden"; + Text[ hindi ] = "समतल सूच्याकार स्तंभ"; + Text[ slovak ] = "Vodorovné ihlany"; +}; +String STR_PYRAMIDQ_3D_2 +{ + Text = "Horizontale ,gestapelte Pyramiden" ; + Text[ ENGLISH ] = "Pyramids, stacked"; + Text[ italian ] = "Piramidi orizzontali sovrapposte"; + Text[ french ] = "Pyramides horizontales empiles" ; + Text[ english_us ] = "Horizontal pyramids, stacked"; + Text[ portuguese ] = "Pirmides horizontais, sobrepostas"; + Text[ russian ] = " , "; + Text[ dutch ] = "Piramiden, gestapeld"; + Text[ spanish ] = "Pirmides horizontales apiladas"; + Text[ danish ] = "Stablede liggende pyramider"; + Text[ swedish ] = "Horisontala, staplade pyramider"; + Text[ polish ] = "Ostrosupy poziome skumulowane"; + Text[ portuguese_brazilian ] = "Pirmides horizontais, empilhadas"; + Text[ japanese ] = "水平な、積み上げた角錐"; + Text[ chinese_simplified ] = "水平向堆积型棱锥体"; + Text[ chinese_traditional ] = "重疊錐體"; + Text[ arabic ] = " "; + Text[ greek ] = " , "; + Text[ korean ] = "수평, 피라미드 누적"; + Text[ turkish ] = "Yatay, ylm piramitler"; + Text[ catalan ] = "Pirmides horizontals apilades"; + Text[ finnish ] = "Vaakapyramidit, pllekkiset"; + Text[ thai ] = "ปิรามิดแนวนอน, กองซ้อน"; + Text[ czech ] = "Vodorovný jehlan, skládaný"; + Text[ hebrew ] = "Horizontale ,gestapelte Pyramiden"; + Text[ hindi ] = "समतल सूच्याकार स्तंभ, स्टॉक किया हुआ"; + Text[ slovak ] = "Vodorovné ihlany, skladané"; +}; +String STR_PYRAMIDQ_3D_3 +{ + Text = "Horizontale Pyramiden, Prozent"; + Text[ ENGLISH ] = "Pyramids, percent"; + Text[ italian ] = "Piramidi orizzontali, percentuale"; + Text[ french ] = "Pyramides horizontales, pourcentage"; + Text[ english_us ] = "Horizontal pyramids, percent"; + Text[ portuguese ] = "Pirmides horizontais, percentuais"; + Text[ russian ] = " , "; + Text[ dutch ] = "Piramiden, procent"; + Text[ spanish ] = "Pirmides horizontales, porcentaje"; + Text[ danish ] = "Liggende pyramider, procent"; + Text[ swedish ] = "Horisontala pyramider, procent"; + Text[ polish ] = "Ostrosupy poziome procentowe"; + Text[ portuguese_brazilian ] = "Pirmides horizontais, percentuais"; + Text[ japanese ] = "水平な角錐、パーセント"; + Text[ chinese_simplified ] = "水平向百分比棱锥体"; + Text[ chinese_traditional ] = "百分比錐體"; + Text[ arabic ] = " "; + Text[ greek ] = " , (%)"; + Text[ korean ] = "수평 피라미드, 백분율"; + Text[ turkish ] = "Yatay piramit, yzde"; + Text[ catalan ] = "Pirmides horitzontals, percent"; + Text[ finnish ] = "Vaakapyramidit, prosentti"; + Text[ thai ] = "ปิรามิดแนวนอน, เปอร์เซ็นต์"; + Text[ czech ] = "Vodorovný jehlan, procenta"; + Text[ hebrew ] = "Horizontale Pyramiden, Prozent"; + Text[ hindi ] = "Horizontal pyramids, percent"; + Text[ slovak ] = "Vodorovné ihlany, percentuálne"; +}; +String STR_PYRAMIDQ_3D_4 +{ + Text = "Horizontale Pyramiden, Tief" ; + Text[ ENGLISH ] = "Pyramids, deep"; + Text[ italian ] = "Piramidi orizzontali, in basso" ; + Text[ french ] = "Pyramides horizontales, en profondeur" ; + Text[ english_us ] = "Horizontal pyramids, deep"; + Text[ portuguese ] = "Pirmides horizontais, com profundidade"; + Text[ russian ] = " , "; + Text[ dutch ] = "Piramiden, met diepte"; + Text[ spanish ] = "Pirmides horizontales, en profundidad"; + Text[ danish ] = "Liggende pyramider, dyb"; + Text[ swedish ] = "Horisontala pyramider, djupa"; + Text[ polish ] = "Ostrosupy poziome przestrzenne"; + Text[ portuguese_brazilian ] = "Pirmides horizontais, com profundidade"; + Text[ japanese ] = "水平な角錐、奥行きあり"; + Text[ chinese_simplified ] = "带深度的水平向棱锥体"; + Text[ chinese_traditional ] = "深向錐體"; + Text[ arabic ] = " "; + Text[ greek ] = " , "; + Text[ korean ] = "수평 피라미드, 깊이"; + Text[ turkish ] = "Yatay piramit, derin"; + Text[ catalan ] = "Pirmides horizontals, en profunditat"; + Text[ finnish ] = "Vaakapyramidit, syvt"; + Text[ thai ] = "ปิรามิดแนวนอน, ลึก"; + Text[ czech ] = "Vodorovný jehlan, hloubka"; + Text[ hebrew ] = "Horizontale Pyramiden, Tief"; + Text[ hindi ] = "समतल सूच्याकार स्तंभ, गहरा"; + Text[ slovak ] = "Vodorovné ihlany, do hĺbky"; +}; +//----------------------------------- + +String STR_KEGEL_3D_1 +{ + Text = "Kegel" ; + Text[ ENGLISH ] = "Cones"; + Text[ italian ] = "Coni" ; + Text[ french ] = "Cnes" ; + Text[ english_us ] = "Cones"; + Text[ portuguese ] = "Cones"; + Text[ russian ] = ""; + Text[ dutch ] = "kegels"; + Text[ spanish ] = "Conos"; + Text[ danish ] = "Kegler"; + Text[ swedish ] = "Kon"; + Text[ polish ] = "Stoki"; + Text[ portuguese_brazilian ] = "Cones"; + Text[ japanese ] = "円錐"; + Text[ chinese_simplified ] = "圆锥体"; + Text[ chinese_traditional ] = "圓錐"; + Text[ arabic ] = ""; + Text[ greek ] = "K"; + Text[ korean ] = "원추형"; + Text[ turkish ] = "Koni"; + Text[ catalan ] = "Cons"; + Text[ finnish ] = "Kartiot"; + Text[ thai ] = "กรวย"; + Text[ czech ] = "Kužele"; + Text[ hebrew ] = "Kegel"; + Text[ hindi ] = "शंकु"; + Text[ slovak ] = "Kužele"; +}; +String STR_KEGEL_3D_2 +{ + Text = "Gestapelte Kegel" ; + Text[ ENGLISH ] = "Cones, stacked"; + Text[ italian ] = "Coni sovrapposti" ; + Text[ french ] = "Cnes empils" ; + Text[ english_us ] = "Cones, stacked"; + Text[ portuguese ] = "Cones, sobrepostos"; + Text[ russian ] = ", "; + Text[ dutch ] = "kegels, gestapeld"; + Text[ spanish ] = "Conos apilados"; + Text[ danish ] = "Stablede kegler"; + Text[ swedish ] = "Staplade koner"; + Text[ polish ] = "Stoki skumulowane"; + Text[ portuguese_brazilian ] = "Cones, empilhados"; + Text[ japanese ] = "積み上げ円錐"; + Text[ chinese_simplified ] = "堆积型圆锥体"; + Text[ chinese_traditional ] = "重疊圓錐"; + Text[ arabic ] = " "; + Text[ greek ] = ", "; + Text[ korean ] = "쌓아 올린 원추형"; + Text[ turkish ] = "Ylm koni"; + Text[ catalan ] = "Cons, apilats"; + Text[ finnish ] = "Kartiot, pllekkiset"; + Text[ thai ] = "กรวย, กองซ้อน"; + Text[ czech ] = "Kužele, skládané"; + Text[ hebrew ] = "Gestapelte Kegel"; + Text[ hindi ] = "शंकु, स्टॉक की हुयी"; + Text[ slovak ] = "Kužele, skladané"; +}; +String STR_KEGEL_3D_3 +{ + Text = "Kegel, Prozent"; + Text[ ENGLISH ] = "Cones, percent"; + Text[ italian ] = "Coni, percentuale"; + Text[ french ] = "Cnes, pourcentage"; + Text[ english_us ] = "Cones, percent"; + Text[ portuguese ] = "Cones, percentuais"; + Text[ russian ] = ", "; + Text[ dutch ] = "kegels, procent"; + Text[ spanish ] = "Conos, porciento"; + Text[ danish ] = "Kegler, procent"; + Text[ swedish ] = "Kon, procent"; + Text[ polish ] = "Stoki procentowe"; + Text[ portuguese_brazilian ] = "Cones, percentuais"; + Text[ japanese ] = "円錐、パーセント"; + Text[ chinese_simplified ] = "百分比圆锥体"; + Text[ chinese_traditional ] = "百分比圓錐"; + Text[ arabic ] = " "; + Text[ greek ] = "K. (%)"; + Text[ korean ] = "원추형 퍼센트"; + Text[ turkish ] = "Koni, yzde"; + Text[ catalan ] = "Cons, percentatge"; + Text[ finnish ] = "Kartiot, prosentti"; + Text[ thai ] = "กรวย, เปอร์เซ็นต์"; + Text[ czech ] = "Kužele, procenta"; + Text[ hebrew ] = "Kegel, Prozent"; + Text[ hindi ] = "शंकु, प्रतिशत"; + Text[ slovak ] = "Kužele, percentuálne"; +}; +String STR_KEGEL_3D_4 +{ + Text = "Kegel, Tief" ; + Text[ ENGLISH ] = "Cones, deep"; + Text[ italian ] = "Cono, in basso" ; + Text[ french ] = "Cnes, en profondeur" ; + Text[ english_us ] = "Cones, deep"; + Text[ portuguese ] = "Cones, com profundidade"; + Text[ russian ] = ", "; + Text[ dutch ] = "kegels, met diepte"; + Text[ spanish ] = "Conos, en profundidad"; + Text[ danish ] = "Kegler, dyb"; + Text[ swedish ] = "Kon, djup"; + Text[ polish ] = "Stoki przestrzenne"; + Text[ portuguese_brazilian ] = "Cones, com profundidade"; + Text[ japanese ] = "円錐、奥行きあり"; + Text[ chinese_simplified ] = "带深度的圆锥体"; + Text[ chinese_traditional ] = "深向圓錐"; + Text[ arabic ] = " "; + Text[ greek ] = ", "; + Text[ korean ] = "원추형 깊이"; + Text[ turkish ] = "Koni, derin"; + Text[ catalan ] = "Cons, profunditat"; + Text[ finnish ] = "Kartiot, syvt"; + Text[ thai ] = "กรวย, ลึก"; + Text[ czech ] = "Kužele, hloubka"; + Text[ hebrew ] = "Kegel, Tief"; + Text[ hindi ] = "शंकु, गहरा"; + Text[ slovak ] = "Kužele, do hĺbky"; +}; +//----------------------------------- +String STR_KEGELQ_3D_1 +{ + Text = "Horizontale Kegel" ; + Text[ ENGLISH ] = "Cones"; + Text[ italian ] = "Coni orizzontali" ; + Text[ french ] = "Cnes horizontaux" ; + Text[ english_us ] = "Horizontal cones"; + Text[ portuguese ] = "Cones horizontais"; + Text[ russian ] = " "; + Text[ dutch ] = "horizontale kegels"; + Text[ spanish ] = "Conos horizontales"; + Text[ danish ] = "Liggende kegler"; + Text[ swedish ] = "Horisontal kon"; + Text[ polish ] = "Stoki poziome"; + Text[ portuguese_brazilian ] = "Cones horizontais"; + Text[ japanese ] = "水平の円錐"; + Text[ chinese_simplified ] = "水平向圆锥体"; + Text[ chinese_traditional ] = "水平圓錐"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "수평 원추형"; + Text[ turkish ] = "Yatay koni"; + Text[ catalan ] = "Cons horitzontals"; + Text[ finnish ] = "Vaakakartiot"; + Text[ thai ] = "กรวยแนวนอน"; + Text[ czech ] = "Vodorovné kužele"; + Text[ hebrew ] = "Horizontale Kegel"; + Text[ hindi ] = "समतल शंकु"; + Text[ slovak ] = "Vodorovné kužele"; +}; +String STR_KEGELQ_3D_2 +{ + Text = "Horizontale ,gestapelte Kegel" ; + Text[ ENGLISH ] = "Cones, stacked"; + Text[ italian ] = "Coni orizzontali sovrapposti" ; + Text[ french ] = "Cnes horizontaux empils" ; + Text[ english_us ] = "Horizontal, stacked cones"; + Text[ portuguese ] = "Cones horizontais, sobrepostos"; + Text[ russian ] = " , "; + Text[ dutch ] = "horizontale kegels, gestapeld"; + Text[ spanish ] = "Conos horizontales apilados"; + Text[ danish ] = "Stablede liggende kegler"; + Text[ swedish ] = "Horisontala, staplade koner"; + Text[ polish ] = "Stoki poziome skumulowane"; + Text[ portuguese_brazilian ] = "Cones horizontais, empilhados"; + Text[ japanese ] = "水平の積み上げ円錐"; + Text[ chinese_simplified ] = "水平向堆积型圆锥体"; + Text[ chinese_traditional ] = "重疊圓錐"; + Text[ arabic ] = " "; + Text[ greek ] = ", "; + Text[ korean ] = "수평으로 쌓아 올린 원추형"; + Text[ turkish ] = "Yatay, ylm koniler"; + Text[ catalan ] = "Cons horitzontals, apilats"; + Text[ finnish ] = "Vaakataso, pllekkiset kartiot"; + Text[ thai ] = "แนวนอน, กรวยกองซ้อน"; + Text[ czech ] = "Vodorovné kužele, skládané"; + Text[ hebrew ] = "Horizontale ,gestapelte Kegel"; + Text[ hindi ] = "समतल , स्टॉक की हुयी शंकु"; + Text[ slovak ] = "Vodorovné kužele, skladané"; +}; +String STR_KEGELQ_3D_3 +{ + Text = "Horizontale Kegel, Prozent"; + Text[ ENGLISH ] = "Cones, percent"; + Text[ italian ] = "Coni orizzontali, percentuale"; + Text[ french ] = "Cnes horizontaux, pourcentage"; + Text[ english_us ] = "Horizintal cones, percent"; + Text[ portuguese ] = "Cones horizontais, percentuais"; + Text[ russian ] = " , "; + Text[ dutch ] = "horizontale kegels, procent"; + Text[ spanish ] = "Conos horizontal, porciento"; + Text[ danish ] = "Liggende kegler, procent"; + Text[ swedish ] = "Horisontal kon, procent"; + Text[ polish ] = "Stoki poziome procentowe"; + Text[ portuguese_brazilian ] = "Cones horizontais, percentuais"; + Text[ japanese ] = "水平の円錐、パーセント"; + Text[ chinese_simplified ] = "水平向百分比圆锥体"; + Text[ chinese_traditional ] = "百分比圓錐"; + Text[ arabic ] = " "; + Text[ greek ] = " , (%)"; + Text[ korean ] = "수평 원추형 퍼센트"; + Text[ turkish ] = "Yatay koni, yzde"; + Text[ catalan ] = "Cons horitzontals, percentatge"; + Text[ finnish ] = "Vaakakartiot, prosentti"; + Text[ thai ] = "กรวยแนวนอน, เปอร์เซ็นต์"; + Text[ czech ] = "Vodorovné kužele, procenta"; + Text[ hebrew ] = "Horizontale Kegel, Prozent"; + Text[ hindi ] = "समतल शंकु, प्रतिशत"; + Text[ slovak ] = "Vodorovné kužele, percentuálne"; +}; +String STR_KEGELQ_3D_4 +{ + Text = "Horizontale Kegel, Tief" ; + Text[ ENGLISH ] = "Cones, deep"; + Text[ italian ] = "Coni orizzontali, in basso" ; + Text[ french ] = "Cnes horizontaux, en profondeur" ; + Text[ english_us ] = "Horizontal cones, deep"; + Text[ portuguese ] = "Cones horizontais, com profundidade"; + Text[ russian ] = " , "; + Text[ dutch ] = "horizontale kegels, met diepte"; + Text[ spanish ] = "Conos horizontales, en profundidad"; + Text[ danish ] = "Liggende kegler, dyb"; + Text[ swedish ] = "Horisontal kon, djup"; + Text[ polish ] = "Stoki poziome przestrzenne"; + Text[ portuguese_brazilian ] = "Cones horizontais, com profundidade"; + Text[ japanese ] = "水平の円錐、奥行きあり"; + Text[ chinese_simplified ] = "带深度的水平向圆锥体"; + Text[ chinese_traditional ] = "深向圓錐"; + Text[ arabic ] = " "; + Text[ greek ] = " , "; + Text[ korean ] = "수평 원추형 깊이"; + Text[ turkish ] = "Yatay koni, derin"; + Text[ catalan ] = "Cons horitzontals, profunditat"; + Text[ finnish ] = "Vaakakartiot, syvt"; + Text[ thai ] = "กรวยแนวนอน, ลึก"; + Text[ czech ] = "Vodorovné kužele, hloubka"; + Text[ hebrew ] = "Horizontale Kegel, Tief"; + Text[ hindi ] = "समतल शंकु, गहरा"; + Text[ slovak ] = "Vodorovné kužele, do hĺbky"; +}; +//----------------------------------- diff --git a/chart2/source/controller/dialogs/Strings_Scale.src b/chart2/source/controller/dialogs/Strings_Scale.src new file mode 100644 index 000000000000..0bb99c7dc220 --- /dev/null +++ b/chart2/source/controller/dialogs/Strings_Scale.src @@ -0,0 +1,283 @@ +/************************************************************************* + * + * $RCSfile: Strings_Scale.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Strings.hrc" + +String STR_INVALID_NUMBER +{ + Text = "Ungltige Zahl." ; + Text [ ENGLISH ] = "Invalid number." ; + Text [ norwegian ] = "Ugyldig tall." ; + Text [ italian ] = "Numero non valido." ; + Text [ portuguese_brazilian ] = "Nmero invalido" ; + Text [ portuguese ] = "Nmero incorrecto" ; + Text [ finnish ] = "Virheellinen numero" ; + Text [ danish ] = "Ugyldigt tal." ; + Text [ french ] = "Nombre incorrect" ; + Text [ swedish ] = "Ogiltigt tal" ; + Text [ dutch ] = "Ongeldig getal" ; + Text [ spanish ] = "Nmero no vlido" ; + Text [ english_us ] = "Invalid number" ; + Text[ chinese_simplified ] = "无效的数字"; + Text[ russian ] = " "; + Text[ polish ] = "Nieprawidowa liczba"; + Text[ japanese ] = "無効数"; + Text[ chinese_traditional ] = "無效的數字"; + Text[ arabic ] = " ."; + Text[ greek ] = " ."; + Text[ korean ] = "잘못된 숫자"; + Text[ turkish ] = "Geersiz say."; + Text[ catalan ] = "Nmero no vlid."; + Text[ thai ] = "ตัวเลขไม่ถูกต้อง"; + Text[ czech ] = "Neplatné číslo"; + Text[ hebrew ] = "Ungültige Zahl."; + Text[ hindi ] = "Invalid number"; + Text[ slovak ] = "Neplatné číslo"; +}; +String STR_MINVALUE_LT_MAXVALUE +{ + Text = "Minimum muss kleiner als Maximum sein." ; + Text [ ENGLISH ] = "Minimum must be lower than Maximum." ; + Text [ norwegian ] = "Minimum m vre lavere enn Maksimum." ; + Text [ italian ] = "Il minimo deve essere inferiore al massimo." ; + Text [ portuguese_brazilian ] = "O mnimo deve ser menor que o mximo." ; + Text [ portuguese ] = "O mnimo deve ser menor que o mximo." ; + Text [ finnish ] = "Vhimmismrn on oltava pienempi kuin enimmismrn." ; + Text [ danish ] = "Minimum skal vre mindre end maksimum." ; + Text [ french ] = "Le minimum doit tre infrieur au maximum !" ; + Text [ swedish ] = "Minimum mste vara mindre n maximum." ; + Text [ dutch ] = "Minimum moet lager zijn dan maximum." ; + Text [ spanish ] = "El mnimo tiene que ser menor que el mximo." ; + Text [ english_us ] = "Minimum must be lower than maximum." ; + Text[ chinese_simplified ] = "最小值必须小于最大值。"; + Text[ russian ] = " , ."; + Text[ polish ] = "Minimum musi by mniejsze ni maksimum."; + Text[ japanese ] = "最小値は最大値より小さくなければなりません。"; + Text[ chinese_traditional ] = "最小值必須小於最大值。"; + Text[ arabic ] = " ."; + Text[ greek ] = " ."; + Text[ korean ] = "최소값은 반드시 최대값보다 작아야 합니다."; + Text[ turkish ] = "Minimum, maksimumdan daha kk olmaldr."; + Text[ catalan ] = "El mnim ha de ser menor que el mxim."; + Text[ thai ] = "จำนวนน้อยที่สุดต้องต่ำกว่าจำนวนมากที่สุด"; + Text[ czech ] = "Minimum musí být nižší než maximum."; + Text[ hebrew ] = "Minimum muss kleiner als Maximum sein."; + Text[ hindi ] = "Minimum must be lower than maximum."; + Text[ slovak ] = "Minimum musí byť menšie ako maximum."; +}; +String STR_STEP_GT_ZERO +{ + Text = "Intervall muss grer als 0 sein." ; + Text [ ENGLISH ] = "Step must be greater than 0." ; + Text [ english_us ] = "Interval must be greater than 0." ; + Text [ italian ] = "L'intervallo deve essere maggiore di 0." ; + Text [ spanish ] = "El intervalo tiene que ser mayor que 0." ; + Text [ french ] = "L'intervalle doit tre suprieur 0" ; + Text [ dutch ] = "Interval moet groter dan 0 zijn" ; + Text [ swedish ] = "Intervall mste vara strre n 0." ; + Text [ danish ] = "Intervallet skal vre strre end 0." ; + Text [ portuguese ] = "O intervalo deve ser maior que 0." ; + Text [ portuguese_brazilian ] = "O intervalo deve ser maior que 0." ; + Text[ chinese_simplified ] = "区间值必须大于零。"; + Text[ russian ] = " ."; + Text[ polish ] = "Przedzia musi by wikszy od 0."; + Text[ japanese ] = "目盛間隔は、0より大きくなければなりません。"; + Text[ chinese_traditional ] = "區間值必須大於零。"; + Text[ arabic ] = " 0."; + Text[ greek ] = " 0."; + Text[ korean ] = "간격은 반드시 0보다 커야 합니다."; + Text[ turkish ] = "Aralk, 0'dan byk olmaldr."; + Text[ catalan ] = "L'intrval ha de ser ms gran de 0."; + Text[ finnish ] = "Vlin on oltava suurempi kuin 0."; + Text[ thai ] = "ช่วงต้องมากกว่า 0."; + Text[ czech ] = "Interval musí být vyšší než 0."; + Text[ hebrew ] = "Intervall muss größer als 0 sein."; + Text[ hindi ] = "अंतराल 0 से अधिक होना चाहिए ।"; + Text[ slovak ] = "Interval musí byť väčší ako 0."; +}; +/* +String STR_STEPMAIN_LT_MAXVALUE +{ + Text = "Das Hauptintervall darf nicht grer als der Wertebereich sein." ; + Text [ ENGLISH ] = "The Main step must not be greater than the value range."; + Text [ english_us ] = "Major interval must not be larger than the range definition."; + Text [ norwegian ] = "Hovedtrinnet m vre lavere enn Maksimum." ; + Text [ italian ] = "L'intervallo principale deve essere inferiore all'area dei valori." ; + Text [ portuguese_brazilian ] = "O intervalo principal no pode ser maior que o intervalo definido." ; + Text [ portuguese ] = "O intervalo principal no pode ser maior que a rea de valores." ; + Text [ finnish ] = "Pvli ei saa olla suurempi kuin aluemritys." ; + Text [ danish ] = "Hovedintervallet m ikke vre strre end vrdiomrdet." ; + Text [ french ] = "L'intervalle principal ne peut pas tre suprieur la plage de valeurs." ; + Text [ swedish ] = "Huvudintervallet fr inte vara strre n vrdeomrdet." ; + Text [ dutch ] = "Hoofdinterval mag niet groter zijn dan het waardebereik" ; + Text [ spanish ] = "El intervalo principal no debe ser mayor que el rea de valores." ; + Text [ english_us ] = "Major interval must not be larger than the range definition." ; + Text[ chinese_simplified ] = "主区间值不能大于数值区域范围。"; + Text[ russian ] = " ."; + Text[ polish ] = "Przedzia gwny nie moe by wikszy od zdefiniowanego zakresu."; + Text[ japanese ] = "主目盛間隔は数値範囲を超えてはいけません。"; + Text[ chinese_traditional ] = "主區間值必須小於定義的最大值。"; + Text[ arabic ] = " ."; + Text[ greek ] = " ."; + Text[ korean ] = "주 간격이 값 범위보다 작거나 같아야 합니다."; + Text[ turkish ] = "Ana aralk, deer aralndan daha byk olmamaldr."; + Text[ catalan ] = "L'intrval principal no ha de ser ms gran que l'rea de valors."; + Text[ thai ] = "ช่วงหลักต้องไม่มากกว่าคำจำกัดความของช่วง"; + Text[ czech ] = "Hlavní interval musí být větší než určení okrajů."; + Text[ hebrew ] = "Das Hauptintervall darf nicht größer als der Wertebereich sein."; + Text[ hindi ] = "Main interval must not be larger than the range definition."; + Text[ slovak ] = "Hlavný interval nesmie byť väčší ako definovaná oblasť."; +}; +*/ +// String STR_STEPHELP_LT_STEPMAIN +// { +// Text = "Teilintervall muss kleiner als Hauptintervall sein." ; +// Text [ ENGLISH ] = "Help step must be lower than Main Step." ; +// Text [ norwegian ] = "Hjelpetrinnet m vre lavere enn Hovedtrinnet." ; +// Text [ italian ] = "L'intervallo ausiliario deve essere inferiore all'intervallo principale." ; +// Text [ portuguese_brazilian ] = "O intervalo auxiliar deve ser menor que o intervalo principal." ; +// Text [ portuguese ] = "O intervalo auxiliar deve ser menor que o intervalo principal." ; +// Text [ finnish ] = "Ohjevlin on oltava pienempi kuin pvlin." ; +// Text [ danish ] = "Underintervallet skal vre strre end hovedintervallet." ; +// Text [ french ] = "L'intervalle secondaire doit tre infrieur l'intervalle principal." ; +// Text [ swedish ] = "Delintervall mste vara mindre n huvudintervall." ; +// Text [ dutch ] = "Hulpinverval moet kleiner zijn dan hoofdinterval" ; +// Text [ spanish ] = "El intervalo auxiliar debe ser inferior al intervalo principal." ; +// Text [ english_us ] = "Minor interval must be smaller than the major interval." ; +// Text[ chinese_simplified ] = "次区间值必须小于主区间值。"; +// Text[ russian ] = " ."; +// Text[ polish ] = "Przedzia pomocniczy musi by mniejszy ni przedzia gwny."; +// Text[ japanese ] = "補助目盛間隔は、主目盛間隔より小さくなければなりません。"; +// Text[ chinese_traditional ] = "次區間值必須小於主區間值。"; +// Text[ arabic ] = " ."; +// Text[ greek ] = " ."; +// Text[ korean ] = "보조 간격은 주 간격보다 작아야 합니다."; +// Text[ turkish ] = "Kk zaman aral byk zaman aralndan kk olmaldr."; +// Text[ catalan ] = "L'intrval auxiliar ha de ser ms petit que l'intrval principal."; +// Text[ thai ] = "ช่วงช่วยเหลือต้องน้อยกว่าช่วงหลัก"; +// Text[ czech ] = "Pomocný interval musí být menší než hlavní interval."; +// Text[ hebrew ] = "Teilintervall muss kleiner als Hauptintervall sein."; +// Text[ hindi ] = "Help interval must be smaller than the main interval."; +// Text[ slovak ] = "Pomocný interval musí byť menší ako hlavný interval."; +// }; +/* +String STR_WRONG_ORIGIN +{ + Text = "Der Koordinatenursprung ist kleiner/grer als das\nWerteminimum/-maximum." ; + Text [ ENGLISH ] = "Origin is less/greater than Minimum/Maximum." ; + Text [ english_us ] = "The coordinate origin is less/greater than the\nminimum/maximum value." ; + Text [ italian ] = "L'origine delle coordinate maggiore / minore del \nvalore minimo/valore massimo" ; + Text [ spanish ] = "El origen de las coordenadas es mayor/menor que el\nmnimo/mximo del valor." ; + Text [ french ] = "L'origine de la coordonne est infrieure/suprieure\nau minimum/maximum des valeurs." ; + Text [ dutch ] = "Het origineel is kleiner/groter dan de \nminimum-/maximumwaarde" ; + Text [ swedish ] = "Koordinatursprunget r strre/mindre n\nminimi/maximi-vrdet." ; + Text [ danish ] = "Koordinatoprindelsen er mindre/strre end\nmininimum-/maksimumvrdien." ; + Text [ portuguese ] = "A origem das coordenadas maior/menor que o mnimo/mximo dos valores." ; + Text [ portuguese_brazilian ] = "A origem das coordenadas menor/maior que o valor mnimo/mximo." ; + Text[ chinese_simplified ] = "原点值大于/小于这个\n最大值/最小值。"; + Text[ russian ] = " /, \n/ ."; + Text[ polish ] = "Pocztek ukadu wsprzdnych jest mniejszy/wikszy ni \nwarto minimalna/maksymalna."; + Text[ japanese ] = "座標軸の原点は、最小値/最大値より\n大きい/小さいです。"; + Text[ chinese_traditional ] = "原點值大於/小於這個\n\n最大值/最小值。"; + Text[ arabic ] = " / \n /."; + Text[ greek ] = " \n / / ."; + Text[ korean ] = "좌표 시작 값이 최대/최소 값보다 작거나/큽니다."; + Text[ turkish ] = "Kordinat kayna \nasgari/azami deerinden fazla/eksik."; + Text[ catalan ] = "L'origen de les coordenades s major/menor que el\nmnim/mxim del valor."; + Text[ finnish ] = "Koordinaatiston origo on pienempi/suurempi kuin \nvhimmis-/enimmisarvo."; + Text[ thai ] = "พิกัดเริ่มต้นน้อยกว่า/มากกว่า\nค่าน้อยที่สุด/มากที่สุด"; + Text[ czech ] = "Počátek souřadnic je menší/větší než\nminimální/maximální hodnota."; + Text[ hebrew ] = "Der Koordinatenursprung ist kleiner/größer als das\nWerteminimum/-maximum."; + Text[ hindi ] = "The coordinate origin is less/greater than the\nminimum/maximum value."; + Text[ slovak ] = "Začiatok súradnice je menší/väčší ako\nminimum/maximum."; +}; +*/ +/* +String STR_BAD_LOGARITHM +{ + Text = "In logarithmischer Darstellung mssen Nullpunkt und Minimum\ngrer als 0 sein." ; + Text [ ENGLISH ] = "Origin or Minimum must be greater than 0 in\nlogarithm view." ; + Text [ english_us ] = "In logarithm view, the origin and minimum must be greater than 0\n." ; + Text [ dutch ] = "In logaritmische weergave moeten nulpunt en minimum\ngroter dan 0 zijn." ; + Text [ italian ] = "Nella rappresentazione logaritmica il punto zero e minimo devono essere\nmaggiori di 0." ; + Text [ spanish ] = "En una representacin logartmica el origen y el mnimo\ntienen que ser mayor que 0." ; + Text [ french ] = "Dans la reprsentation logarithmique, l'origine et le minimum\ndoivent tre suprieurs 0." ; + Text [ swedish ] = "I logaritmisk visning mste ursprunget och minimum vara\nstrre n 0." ; + Text [ danish ] = "I en logaritmisk visning skal nulpunkt og minimum\nvre strre end 0." ; + Text [ portuguese ] = "Numa apresentao logartmica os pontos zero e o \n mnimo devem ser maiores que 0." ; + Text [ portuguese_brazilian ] = "Numa grfico logartmico, a origem e o mnimo devem ser maiores que 0\n." ; + Text[ chinese_simplified ] = "对数表达式中的原点和数值不允许小于零。"; + Text[ russian ] = " \n ."; + Text[ polish ] = "W widoku logarytmicznym pocztek i minimum musz by wiksze od zera.\n"; + Text[ japanese ] = "対数表示において零点と最小値は\n0よりも大きくなければなりません。"; + Text[ chinese_traditional ] = "對數顯示中的數值不允許小於零。"; + Text[ arabic ] = " \n 0."; + Text[ greek ] = " \n 0."; + Text[ korean ] = "로그 보기에서는 원점과 극소점이\n 0보다 커야 합니다."; + Text[ turkish ] = "Logaritmik grnmde, sfr noktas ve minimum 0'dan\nbyk olmaldr."; + Text[ catalan ] = "En una representaci logartmica l'origen i el mnim\nhan de ser ms grans que 0."; + Text[ finnish ] = "Logaritminkymss aloitusarvo ja pienin arvo eivt saa olla suurempia kuin 0.\n"; + Text[ thai ] = "ในมุมมองลอการิธึม จุดเริ่มต้นและน้อยที่สุดต้องมากกว่า 0\n."; + Text[ czech ] = "V logaritmickém pohledu musí být minimum a originál vyšší než 0\n."; + Text[ hebrew ] = "In logarithmischer Darstellung müssen Nullpunkt und Minimum\ngrößer als 0 sein."; + Text[ hindi ] = "In logarithm view, the origin and minimum must be greater than 0\n."; + Text[ slovak ] = "V logaritmickom zobrazení musí byť začiatok aj minimum väčšie ako 0."; +}; +*/ diff --git a/chart2/source/controller/dialogs/Strings_Statistic.src b/chart2/source/controller/dialogs/Strings_Statistic.src new file mode 100644 index 000000000000..f8cbaddb6d52 --- /dev/null +++ b/chart2/source/controller/dialogs/Strings_Statistic.src @@ -0,0 +1,338 @@ +/************************************************************************* + * + * $RCSfile: Strings_Statistic.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Strings.hrc" + +//SchStatisticTabPage and SchDataStatisticsDlg +String STR_INDICATE_NONE +{ + Text = "Keine Indikatoren" ; + Text [ ENGLISH ] = "No indicators" ; + Text [ english_us ] = "No Indicators" ; + Text [ italian ] = "Senza indicatori" ; + Text [ spanish ] = "Sin indicadores" ; + Text [ french ] = "Aucun indicateur" ; + Text [ dutch ] = "Geen indicatoren" ; + Text [ swedish ] = "Inga indikatorer" ; + Text [ danish ] = "Ingen indikatorer" ; + Text [ portuguese ] = "Nenhum Indicador" ; + Text [ portuguese_brazilian ] = "Nenhum Indicador" ; + Text[ chinese_simplified ] = "无标示"; + Text[ russian ] = " "; + Text[ polish ] = "Brak wskanikw"; + Text[ japanese ] = "インジケータなし"; + Text[ chinese_traditional ] = "不顯示"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "표시기 없음"; + Text[ turkish ] = "Gsterge yok"; + Text[ catalan ] = "Sense indicadors"; + Text[ finnish ] = "Ei ilmaisimia"; + Text[ thai ] = "ไม่มีตัวบ่งชี้"; + Text[ czech ] = "Bez indikátorů"; + Text[ hebrew ] = "Keine Indikatoren"; + Text[ hindi ] = "No Indicators"; + Text[ slovak ] = "Bez indikátorov"; +}; +String STR_INDICATE_BOTH +{ + Text = "Indikatoren beidseitig" ; + Text [ ENGLISH ] = "Indicators on both sides" ; + Text [ dutch ] = "Indicatoren aan beide kanten" ; + Text [ english_us ] = "Indicators Top and Bottom" ; + Text [ italian ] = "Indicatore su ambedue i lati" ; + Text [ spanish ] = "Indicadores a ambos lados" ; + Text [ french ] = "Indicateurs des deux cts" ; + Text [ swedish ] = "Indikatorer p bda sidor" ; + Text [ danish ] = "Indikatorer p begge sider" ; + Text [ portuguese ] = "Indicadores em ambos os lados" ; + Text [ portuguese_brazilian ] = "Indicadores em cima e em baixo" ; + Text[ chinese_simplified ] = "上下方向的指示"; + Text[ russian ] = " "; + Text[ polish ] = "Wskaniki grne i dolne"; + Text[ japanese ] = "インジケータ上下"; + Text[ language_user1 ] = ": - -"; + Text[ chinese_traditional ] = "上下方向的指示"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "위와 아래 표시기"; + Text[ turkish ] = "Alt ve st gsterge"; + Text[ catalan ] = "Indicadors superiors i inferiors"; + Text[ finnish ] = "Ilmaisimet yl- ja alareunassa"; + Text[ thai ] = "ตัวบ่งชี้บนและล่าง"; + Text[ czech ] = "Indikátory nahoře a dole"; + Text[ hebrew ] = "Indikatoren beidseitig"; + Text[ hindi ] = "निदर्शकें ऊपर और नीचे"; + Text[ slovak ] = "Indikátory hore a dole"; +}; +String STR_INDICATE_DOWN +{ + Text = "Unterer Indikator" ; + Text [ ENGLISH ] = "Lower indicator" ; + Text [ english_us ] = "Lower Indicator" ; + Text [ italian ] = "Indicatore inferiore" ; + Text [ spanish ] = "Indicador inferior" ; + Text [ french ] = "Indicateur infrieur" ; + Text [ dutch ] = "Indicator beneden" ; + Text [ swedish ] = "Undre indikator" ; + Text [ danish ] = "Nederste indikator" ; + Text [ portuguese ] = "Indicador inferior" ; + Text [ portuguese_brazilian ] = "Indicador inferior" ; + Text[ chinese_simplified ] = "下标示"; + Text[ russian ] = " "; + Text[ polish ] = "Dolny wskanik"; + Text[ japanese ] = "インジケータ下"; + Text[ chinese_traditional ] = "下方顯示"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "아래쪽 표시기"; + Text[ turkish ] = "Alt gsterge"; + Text[ catalan ] = "Indicador inferior"; + Text[ finnish ] = "Alempi ilmaisin"; + Text[ thai ] = "ตัวบ่งชี้ต่ำกว่า"; + Text[ czech ] = "Dolní indikátor"; + Text[ hebrew ] = "Unterer Indikator"; + Text[ hindi ] = "Lower Indicator"; + Text[ slovak ] = "Dolný indikátor"; +}; +String STR_INDICATE_UP +{ + Text = "Oberer Indikator" ; + Text [ ENGLISH ] = "Upper indicator" ; + Text [ english_us ] = "Upper Indicator" ; + Text [ italian ] = "Indicatore superiore" ; + Text [ spanish ] = "Indicador superior" ; + Text [ french ] = "Indicateur suprieur" ; + Text [ dutch ] = "Indicator boven" ; + Text [ swedish ] = "vre indikator" ; + Text [ danish ] = "verste indikator" ; + Text [ portuguese ] = "Indicador superior" ; + Text [ portuguese_brazilian ] = "Indicador superior" ; + Text[ chinese_simplified ] = "上标示"; + Text[ russian ] = " "; + Text[ polish ] = "Grny wskanik"; + Text[ japanese ] = "インジケータ上"; + Text[ chinese_traditional ] = "上方顯示"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "위쪽 표시기"; + Text[ turkish ] = "st gsterge"; + Text[ catalan ] = "Indicador superior"; + Text[ finnish ] = "Ylempi ilmaisin"; + Text[ thai ] = "ตัวบ่งชี้สูงกว่า"; + Text[ czech ] = "Horní indikátor"; + Text[ hebrew ] = "Oberer Indikator"; + Text[ hindi ] = "ऊपरी निदर्शक"; + Text[ slovak ] = "Horný indikátor"; +}; + +//------------------------------------------------------------------------ +//------------------------------------------------------------------------ + +String STR_REGRESSION_NONE +{ + Text = "Keine Regression" ; + Text [ ENGLISH ] = "No regression" ; + Text [ dutch ] = "Geen regressie" ; + Text [ english_us ] = "No Regression" ; + Text [ italian ] = "Nessuna regressione" ; + Text [ spanish ] = "Ninguna regresin" ; + Text [ french ] = "Aucune rgression" ; + Text [ swedish ] = "Ingen regression" ; + Text [ danish ] = "Ingen regression" ; + Text [ portuguese ] = "Sem regresso" ; + Text [ portuguese_brazilian ] = "Sem Regresso" ; + Text[ chinese_simplified ] = "无回归"; + Text[ russian ] = " "; + Text[ polish ] = "Brak regresji"; + Text[ japanese ] = "回帰なし"; + Text[ chinese_traditional ] = "無回歸"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "회귀선 없음"; + Text[ turkish ] = "Regresyon yok"; + Text[ catalan ] = "Cap regressi"; + Text[ finnish ] = "Ei regressiota"; + Text[ thai ] = "ไม่ถดถอย"; + Text[ czech ] = "Bez regrese"; + Text[ hebrew ] = "Keine Regression"; + Text[ hindi ] = "No Regression"; + Text[ slovak ] = "Bez regresie"; +}; +String STR_REGRESSION_LINEAR +{ + Text = "Lineare Regression" ; + Text [ ENGLISH ] = "Linear regression" ; + Text [ dutch ] = "Lineaire regressie" ; + Text [ english_us ] = "Linear regression" ; + Text [ italian ] = "Regressione lineare" ; + Text [ spanish ] = "Regresin lineal" ; + Text [ french ] = "Rgression linaire" ; + Text [ swedish ] = "Linjr regression" ; + Text [ danish ] = "Liner regression" ; + Text [ portuguese ] = "Regresso linear" ; + Text [ portuguese_brazilian ] = "Regresso linear" ; + Text[ chinese_simplified ] = "等差回归"; + Text[ russian ] = " "; + Text[ polish ] = "Regresja liniowa"; + Text[ japanese ] = "線形回帰"; + Text[ chinese_traditional ] = "等差回歸"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "선 회귀선"; + Text[ turkish ] = "Dorusal regresyon"; + Text[ catalan ] = "Regressi lineal"; + Text[ finnish ] = "Lineaarinen regressio"; + Text[ thai ] = "ถดถอยแบบเส้นตรง"; + Text[ czech ] = "Lineární regrese"; + Text[ hebrew ] = "Lineare Regression"; + Text[ hindi ] = "Linear regression"; + Text[ slovak ] = "Lineárna regresia"; +}; +String STR_REGRESSION_LOG +{ + Text = "Logarithmische Regression" ; + Text [ ENGLISH ] = "Logarithm regression" ; + Text [ english_us ] = "Logarithm regression" ; + Text [ italian ] = "Regressione logaritmica" ; + Text [ spanish ] = "Regresin logartmica" ; + Text [ french ] = "Rgression logarithmique" ; + Text [ dutch ] = "Logaritmische regressie" ; + Text [ swedish ] = "Logaritmisk regression" ; + Text [ danish ] = "Logaritmisk regression" ; + Text [ portuguese ] = "Regresso logartmica" ; + Text [ portuguese_brazilian ] = "Regresso logartmica" ; + Text[ chinese_simplified ] = "对数回归"; + Text[ russian ] = " "; + Text[ polish ] = "Regresja logarytmiczna"; + Text[ japanese ] = "対数の回帰"; + Text[ chinese_traditional ] = "對數回歸"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "로그 회귀선"; + Text[ turkish ] = "Logaritmik regresyon"; + Text[ catalan ] = "Regressi logartmica"; + Text[ finnish ] = "Logaritminen regressio"; + Text[ thai ] = "ถดถอยแบบลอการิธึม"; + Text[ czech ] = "Logaritmická regrese"; + Text[ hebrew ] = "Logarithmische Regression"; + Text[ hindi ] = "लघुगणक रिग्रेश्यन"; + Text[ slovak ] = "Logaritmická regresia"; +}; +String STR_REGRESSION_EXP +{ + Text = "Exponentielle Regression" ; + Text [ ENGLISH ] = "Exponential regression" ; + Text [ dutch ] = "Exponentile regressie" ; + Text [ english_us ] = "Exponential Regression" ; + Text [ italian ] = "Regressione esponenziale" ; + Text [ spanish ] = "Regresin exponencial" ; + Text [ french ] = "Rgression exponentielle" ; + Text [ swedish ] = "Exponentiell regression" ; + Text [ danish ] = "Eksponentiel regression" ; + Text [ portuguese ] = "Regresso exponencial" ; + Text [ portuguese_brazilian ] = "Regresso exponencial" ; + Text[ chinese_simplified ] = "指数回归"; + Text[ russian ] = " "; + Text[ polish ] = "Regresja wykadnicza"; + Text[ japanese ] = "指数の回帰"; + Text[ chinese_traditional ] = "指數回歸"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "지수 회귀선"; + Text[ turkish ] = "stel regresyon"; + Text[ catalan ] = "Regressi exponencial"; + Text[ finnish ] = "Eksponentiaalinen regressio"; + Text[ thai ] = "ถดถอยแบบเอ็กซ์โปเนนเชียล"; + Text[ czech ] = "Exponenciální regrese"; + Text[ hebrew ] = "Exponentielle Regression"; + Text[ hindi ] = "Exponential Regression"; + Text[ slovak ] = "Exponenciálna regresia"; +}; +String STR_REGRESSION_POWER +{ + Text = "Potenzielle Regression" ; + Text [ ENGLISH ] = "Power regression" ; + Text [ english_us ] = "Power regression" ; + Text [ italian ] = "Regressione potenziale" ; + Text [ spanish ] = "Regresin potencial" ; + Text [ french ] = "Rgression potentielle" ; + Text [ dutch ] = "Potentile regressie" ; + Text [ swedish ] = "Potentiell regression" ; + Text [ danish ] = "Potentiel regression" ; + Text [ portuguese ] = "Regresso potencial" ; + Text [ portuguese_brazilian ] = "Regresso de potncia" ; + Text[ chinese_simplified ] = "位能回归"; + Text[ russian ] = " "; + Text[ polish ] = "Regresja potgowa"; + Text[ japanese ] = "乗羃の回帰"; + Text[ chinese_traditional ] = "指數回歸"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "퍼텐셜회귀선"; + Text[ turkish ] = "Kuvvet regresyonu"; + Text[ catalan ] = "Regressi potencial"; + Text[ finnish ] = "Polynomiregressio"; + Text[ thai ] = "กำลังการถดถอย"; + Text[ czech ] = "Mocninná regrese"; + Text[ hebrew ] = "Potenzielle Regression"; + Text[ hindi ] = "पवर रिग्रेश्यन"; + Text[ slovak ] = "Mocninová regresia"; +}; diff --git a/chart2/source/controller/dialogs/TabPages.hrc b/chart2/source/controller/dialogs/TabPages.hrc new file mode 100644 index 000000000000..5509086f1f86 --- /dev/null +++ b/chart2/source/controller/dialogs/TabPages.hrc @@ -0,0 +1,212 @@ +/************************************************************************* + * + * $RCSfile: TabPages.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_TABPAGES_HRC +#define CHART_TABPAGES_HRC + +//see attrib.hrc in old chart + +#define TP_LEGEND_POS 900 +#define GRP_LEGEND 1 +#define RBT_NONE 1 +#define RBT_LEFT 2 +#define RBT_TOP 3 +#define RBT_RIGHT 4 +#define RBT_BOTTOM 5 + +#define TP_DATA_DESCR 901 +#define CB_VALUE 1 +#define CB_TEXT 2 +#define CB_SYMBOL 3 +#define RB_NUMBER 1 +#define RB_PERCENT 2 + +#define TP_ALIGNMENT 902 +////#define FL_ORDER 2 +////#define RBT_SIDEBYSIDE 1 +////#define RBT_UPDOWN 2 +////#define RBT_DOWNUP 3 +////#define RBT_AUTOORDER 4 + +#define TP_STAT 905 +#define FL_ERROR 1 +#define RBT_NONE 1 +#define RBT_VARIANT 2 +#define RBT_SIGMA 3 +#define RBT_PERCENT 4 +#define RBT_BIGERROR 5 +#define RBT_CONST 6 +#define CBX_AVERAGE 1 +#define MTR_FLD_PERCENT 1 +#define MTR_FLD_BIGERROR 2 +#define MTR_FLD_PLUS 3 +#define MTR_FLD_MINUS 4 +#define FT_PERCENT_PLUS 1 +#define FT_PERCENT_MINUS 2 +#define FT_INDICATE 3 +#define FT_REGRESS 4 +#define CT_INDICATE 1 +#define CT_REGRESS 2 +#define FL_TEXTBREAK 3 +#define CBX_TEXTBREAK 2 +#define CBX_TEXTOVERLAP 4 + +//Seit 4/1998 koennen Texte frei gedreht werden: SCHATTR_TEXT_DEGREES +// ID's for title rotation tabpage +#define CTR_DIAL 6030 +#define BTN_TXTSTACKED 6031 +#define FT_DEGREES 6032 +#define NF_ORIENT 6033 +#define CTR_DUMMY 6034 +#define FT_DUMMY 6035 +#define FL_ALIGN 6037 + +/* +//Symbol-Tabpage (zum Teil sehr Aehnlich der SVX_AREA_TABPAGE) (obsolete) +#define TP_SYMBOL 906 +#define RBT_COLOR 1 +#define RBT_GRADIENT 2 +#define RBT_HATCHING 3 +#define RBT_BITMAP 4 +#define RBT_INVISIBLE 5 +#define LB_COLOR 1 +#define LB_GRADIENT 2 +#define LB_HATCHING 3 +#define LB_BITMAP 4 + +#define GRP_FILL 1 +#define CTL_BITMAP_PREVIEW 6 +*/ +#define TP_LAYOUT 907 +#define FT_LY_SHAPE 1 +#define LB_LY_SHAPE 2 + +#define TP_OPTIONS 908 +#define GRP_OPT_AXIS 1 +#define RBT_OPT_AXIS_1 2 +#define RBT_OPT_AXIS_2 3 +#define MT_GAP 4 +#define MT_OVERLAP 5 +#define FT_GAP 6 +#define FT_OVERLAP 7 +#define GB_BAR 8 +#define CB_CONNECTOR 9 + +//------------ +//from old chart tplabel.hrc + +#define TP_AXIS_LABEL 920 + +#define CB_AXIS_LABEL_SCHOW_DESCR 1 + +//#define FL_AXIS_LABEL_FORMATTING 2 + +#define FL_AXIS_LABEL_ORIENTATION 3 +#define CT_AXIS_LABEL_DIAL 4 +#define PB_AXIS_LABEL_TEXTSTACKED 5 +#define FT_AXIS_LABEL_DEGREES 6 +#define NF_AXIS_LABEL_ORIENT 7 +#define FT_UNUSED 8 +#define CT_UNUSED 9 + +#define FL_AXIS_LABEL_TEXTFLOW 10 +#define CB_AXIS_LABEL_TEXTOVERLAP 11 +#define CB_AXIS_LABEL_TEXTBREAK 12 + +#define FL_AXIS_LABEL_ORDER 13 +#define RB_AXIS_LABEL_SIDEBYSIDE 14 +#define RB_AXIS_LABEL_UPDOWN 15 +#define RB_AXIS_LABEL_DOWNUP 16 +#define RB_AXIS_LABEL_AUTOORDER 17 + +#define FL_SEPARATOR 18 + +#define TP_SCALE_Y 903 + +#define FL_SCALE_Y 1 +#define FL_TICKS 2 +#define FL_HELPTICKS 3 + +#define TXT_MIN 1 +#define TXT_MAX 2 +#define TXT_STEP_MAIN 3 +#define TXT_STEP_HELP 4 +#define TXT_ORIGIN 5 + +#define CBX_AUTO_MIN 1 +#define CBX_AUTO_MAX 2 +#define CBX_AUTO_STEP_MAIN 3 +#define CBX_AUTO_STEP_HELP 4 +#define CBX_AUTO_ORIGIN 5 +#define CBX_LOGARITHM 6 +#define CBX_TICKS_INNER 7 +#define CBX_HELPTICKS_INNER 8 +#define CBX_TICKS_OUTER 9 +#define CBX_HELPTICKS_OUTER 10 + +#define EDT_STEP_MAIN 1 +#define EDT_MAX 2 +#define EDT_MIN 3 +// #define EDT_STEP_HELP 4 +#define EDT_ORIGIN 5 + +#define MT_STEPHELP 10 + +#endif diff --git a/chart2/source/controller/dialogs/dlg_ChartType.cxx b/chart2/source/controller/dialogs/dlg_ChartType.cxx new file mode 100644 index 000000000000..029663b0d9b7 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_ChartType.cxx @@ -0,0 +1,1072 @@ +/************************************************************************* + * + * $RCSfile: dlg_ChartType.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/* +#ifndef _SV_MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif +#include <sfx2/sfxsids.hrc> +#include <svx/eeitem.hxx> +#pragma hdrstop + +#include "schdll.hxx" +#define ITEMID_CHARTSTYLE CHATTR_DIAGRAM_STYLE +#ifndef _SVX_CHRTITEM_HXX //autogen +#include <svx/chrtitem.hxx> +#endif + +#include "strings.hrc" +#include "res_bmp.hrc" +// for high contrast images +#include "res_hc_bmp.hrc" + +#include "schresid.hxx" +#include "chtmodel.hxx" +#include "diagrtyp.hxx" +#include "diagrtyp.hrc" + +#include "chmod3d.hxx" +#include "schattr.hxx" +// TVM: CHTYPE wurde ins Model verschoben +*/ + +#include "dlg_ChartType.hxx" +#include "dlg_ChartType.hrc" +#include "ResId.hxx" +#include "Bitmaps.hrc" +#include "Bitmaps_HC.hrc" +#include "Strings.hrc" + +#include "SchSfxItemIds.hxx" + +//#include "SchAllDefinesFor_svx_chrtitem.hxx" +#define ITEMID_CHARTSTYLE SCHATTR_DIAGRAM_STYLE +#ifndef _SVX_CHRTITEM_HXX +#include <svx/chrtitem.hxx> +#endif + +// header for class SfxInt32Item +#ifndef _SFXINTITEM_HXX +#include <svtools/intitem.hxx> +#endif + +// header for define RET_OK +#ifndef _SV_MSGBOX_HXX +#include <vcl/msgbox.hxx> +#endif + + +#define OFFSET_PYRAMID 1000 +#define OFFSET_ROUND 2000 +#define OFFSET_CONE 3000 + +//GetChartShapeStyle() +//#define CHART_SHAPE3D_IGNORE -2 +#define CHART_SHAPE3D_ANY -1 +//#define CHART_SHAPE3D_SQUARE 0 +#define CHART_SHAPE3D_CYLINDER 1 +#define CHART_SHAPE3D_CONE 2 +#define CHART_SHAPE3D_PYRAMID 3 +//#define CHART_SHAPE3D_HANOI 4 + +// base diagram types +//#define CHTYPE_INVALID 0 +#define CHTYPE_LINE 1 +//#define CHTYPE_LINESYMB 2 // this one has to be removed !! (why?) +#define CHTYPE_AREA 3 +#define CHTYPE_COLUMN 4 // is also a bar-type +#define CHTYPE_BAR 5 +#define CHTYPE_CIRCLE 6 +#define CHTYPE_XY 7 +#define CHTYPE_NET 8 +//#define CHTYPE_DONUT 9 +#define CHTYPE_STOCK 10 +//#define CHTYPE_ADDIN 11 + +//............................................................................. +namespace chart +{ +//............................................................................. + +// macro for selecting a normal or high contrast bitmap the stack variable +// bIsHighContrast must exist and reflect the correct state +#define SELECT_BITMAP(name) Bitmap( SchResId( bIsHighContrast ? name ## _HC : name )) + +SchDiagramTypeDlg::SchDiagramTypeDlg(Window* pWindow, + const SfxItemSet& rInAttrs) : + ModalDialog(pWindow, SchResId(DLG_DIAGRAM_TYPE)), + + n3DGeometry(CHART_SHAPE3D_ANY), + aRbt2D(this, ResId(RBT_2D)), + aRbt3D(this, ResId(RBT_3D)), + aFlDimension(this, ResId(FL_DIMENSION)), + aFtDeep( this, ResId( FT_DEEP ) ), + aMtrFldDeep( this, ResId( MTR_FLD_DEEP ) ), + aFtGran( this, ResId( FT_GRAN ) ), + aMtrFldGran( this, ResId( MTR_FLD_GRAN ) ), + aFtNumLines( this, ResId( FT_NUM_OF_LINES ) ), + aMtrFldNumLines( this, ResId( MTR_FLD_NUM_OF_LINES ) ), + + aFtType(this, ResId(FT_TYPE)), + aCtlType(this, ResId(CTL_TYPE)), + aFtVariant(this, ResId(FT_VARIANT)), + aCtlVariant(this, ResId(CTL_VARIANT)), + aBtnOK(this, ResId(BTN_OK)), + aBtnCancel(this, ResId(BTN_CANCEL)), + aBtnHelp(this, ResId(BTN_HELP)), + eDimension(CHDIM_2D), + rOutAttrs(rInAttrs) +{ + FreeResource(); + + aRbt2D.SetClickHdl(LINK(this, SchDiagramTypeDlg, + SelectDimensionHdl)); + aRbt3D.SetClickHdl(LINK(this, SchDiagramTypeDlg, + SelectDimensionHdl)); + + aCtlType.SetStyle(aCtlType.GetStyle() | + /*WB_ITEMBORDER | WB_DOUBLEBORDER |*/ WB_NAMEFIELD | WB_VSCROLL ); + + aCtlType.SetColCount(4); + aCtlType.SetLineCount(2); + aCtlType.SetExtraSpacing(2); + + aCtlType.SetSelectHdl(LINK(this, SchDiagramTypeDlg, SelectTypeHdl)); + aCtlType.SetDoubleClickHdl(LINK(this, SchDiagramTypeDlg, + DoubleClickHdl)); + + aCtlVariant.SetStyle(aCtlVariant.GetStyle() | + /*WB_ITEMBORDER | WB_DOUBLEBORDER |*/ WB_NAMEFIELD | WB_VSCROLL ); + + aCtlVariant.SetColCount(4); + aCtlVariant.SetLineCount(1); + aCtlVariant.SetExtraSpacing(2); + aCtlVariant.SetDoubleClickHdl(LINK(this, SchDiagramTypeDlg, DoubleClickHdl)); + aCtlVariant.SetSelectHdl(LINK(this, SchDiagramTypeDlg, ClickHdl)); + + Reset(); + + //ToDo: This is just to have some default + SetMaximumNumberOfLines( 12 ); +} + +/************************************************************************* +|* +|* Destruktor +|* +\************************************************************************/ + +SchDiagramTypeDlg::~SchDiagramTypeDlg() +{ +} +/************************************************************************* +|* +|* Initialisierung +|* +\*************************************************************************/ + +void SchDiagramTypeDlg::Reset() +{ + const SfxPoolItem *pPoolItem = NULL; + + if (rOutAttrs.GetItemState(SCHATTR_STYLE_SHAPE, TRUE, &pPoolItem) + == SFX_ITEM_SET) + n3DGeometry=((const SfxInt32Item*)pPoolItem)->GetValue(); + + if (rOutAttrs.GetItemState(SCHATTR_DIAGRAM_STYLE, TRUE, &pPoolItem) + == SFX_ITEM_SET) + { + USHORT nType; + ChartDimension eDim; + + //Hier sollte demnaechst folgendes ersatzweise stehen: + //nType=pDoc->GetBaseType(); + //eDim=(pDoc->GetDisplayDimension()==3)?CHDIM_3D:CHDIM_2D; + + switch (((const SvxChartStyleItem*)pPoolItem)->GetValue()) + { + case CHSTYLE_2D_B_SPLINE : + case CHSTYLE_2D_B_SPLINE_SYMBOL : + case CHSTYLE_2D_LINE: + case CHSTYLE_2D_STACKEDLINE: + case CHSTYLE_2D_PERCENTLINE: + case CHSTYLE_2D_LINESYMBOLS: + case CHSTYLE_2D_STACKEDLINESYM: + case CHSTYLE_2D_PERCENTLINESYM: + case CHSTYLE_2D_CUBIC_SPLINE : + case CHSTYLE_2D_CUBIC_SPLINE_SYMBOL : + nType = CHTYPE_LINE; + eDim = CHDIM_2D; + break; + + case CHSTYLE_2D_COLUMN: + case CHSTYLE_2D_STACKEDCOLUMN: + case CHSTYLE_2D_PERCENTCOLUMN: + case CHSTYLE_2D_LINE_COLUMN: + case CHSTYLE_2D_LINE_STACKEDCOLUMN: + + nType = CHTYPE_COLUMN; + eDim = CHDIM_2D; + break; + + case CHSTYLE_2D_BAR: + case CHSTYLE_2D_STACKEDBAR: + case CHSTYLE_2D_PERCENTBAR: + nType = CHTYPE_BAR; + eDim = CHDIM_2D; + break; + + case CHSTYLE_2D_AREA: + case CHSTYLE_2D_STACKEDAREA: + case CHSTYLE_2D_PERCENTAREA: + nType = CHTYPE_AREA; + eDim = CHDIM_2D; + break; + + case CHSTYLE_2D_PIE: + case CHSTYLE_2D_PIE_SEGOF1: + case CHSTYLE_2D_PIE_SEGOFALL: + case CHSTYLE_2D_DONUT1: + case CHSTYLE_2D_DONUT2: + nType = CHTYPE_CIRCLE; + eDim = CHDIM_2D; + break; + + case CHSTYLE_2D_B_SPLINE_XY : + case CHSTYLE_2D_XY_LINE : + case CHSTYLE_2D_B_SPLINE_SYMBOL_XY : + case CHSTYLE_2D_XYSYMBOLS: + case CHSTYLE_2D_XY: + case CHSTYLE_2D_CUBIC_SPLINE_XY : + case CHSTYLE_2D_CUBIC_SPLINE_SYMBOL_XY : + nType = CHTYPE_XY; + eDim = CHDIM_2D; + break; + + case CHSTYLE_2D_NET: + case CHSTYLE_2D_NET_SYMBOLS: + case CHSTYLE_2D_NET_STACK: + case CHSTYLE_2D_NET_SYMBOLS_STACK: + case CHSTYLE_2D_NET_PERCENT: + case CHSTYLE_2D_NET_SYMBOLS_PERCENT: + nType = CHTYPE_NET; + eDim = CHDIM_2D; + break; + + case CHSTYLE_3D_STRIPE: + nType = CHTYPE_LINE; + eDim = CHDIM_3D; + break; + + case CHSTYLE_3D_COLUMN: + case CHSTYLE_3D_FLATCOLUMN: + case CHSTYLE_3D_STACKEDFLATCOLUMN: + case CHSTYLE_3D_PERCENTFLATCOLUMN: + nType = CHTYPE_COLUMN; + eDim = CHDIM_3D; + break; + + case CHSTYLE_3D_BAR: + case CHSTYLE_3D_FLATBAR: + case CHSTYLE_3D_STACKEDFLATBAR: + case CHSTYLE_3D_PERCENTFLATBAR: + nType = CHTYPE_BAR; + eDim = CHDIM_3D; + break; + + case CHSTYLE_3D_AREA: + case CHSTYLE_3D_STACKEDAREA: + case CHSTYLE_3D_PERCENTAREA: + nType = CHTYPE_AREA; + eDim = CHDIM_3D; + break; + + case CHSTYLE_3D_PIE: + nType = CHTYPE_CIRCLE; + eDim = CHDIM_3D; + break; + + case CHSTYLE_2D_STOCK_1: + case CHSTYLE_2D_STOCK_2: + case CHSTYLE_2D_STOCK_3: + case CHSTYLE_2D_STOCK_4: + nType = CHTYPE_STOCK; + eDim = CHDIM_2D; + break; + + default: + DBG_ERROR("Invalid chart style given!"); + return; + } + + if (eDim == CHDIM_3D) + { + aRbt3D.Check(TRUE); + eDimension = CHDIM_2D; + SelectDimensionHdl(&aRbt3D); + } + else + { + aRbt2D.Check(TRUE); + eDimension = CHDIM_3D; + SelectDimensionHdl(&aRbt2D); + } + + aCtlType.SelectItem(nType); + SelectTypeHdl(&aCtlType); + + USHORT nItemChartType = static_cast< USHORT >( + static_cast< const SvxChartStyleItem * >( pPoolItem )->GetValue() ); + + SwitchDepth( nItemChartType ); + SwitchNumLines( nItemChartType ); + } + + if (rOutAttrs.GetItemState(SCHATTR_NUM_OF_LINES_FOR_BAR, TRUE, &pPoolItem) + == SFX_ITEM_SET) + { + aMtrFldNumLines.SetValue( + reinterpret_cast< const SfxInt32Item * >( pPoolItem )->GetValue()); + } + + if (rOutAttrs.GetItemState(SCHATTR_SPLINE_RESOLUTION, TRUE, &pPoolItem) + == SFX_ITEM_SET) + { + aMtrFldGran.SetValue( + reinterpret_cast< const SfxInt32Item * >( pPoolItem )->GetValue()); + } + + if (rOutAttrs.GetItemState(SCHATTR_SPLINE_ORDER, TRUE, &pPoolItem) + ==SFX_ITEM_SET) + { + aMtrFldDeep.SetValue( + reinterpret_cast< const SfxInt32Item * >( pPoolItem )->GetValue()); + } +} + +/************************************************************************* +|* +|* Fuellt das Typ-Set mit Bitmaps +|* +\************************************************************************/ + +void SchDiagramTypeDlg::FillTypeSet(ChartDimension eDim, bool bForce /* default: false */ ) +{ + if (eDim != eDimension || bForce) + { + eDimension = eDim; + + USHORT nSelId = aCtlType.IsNoSelection() ? + 0 : aCtlType.GetSelectItemId(); + + aCtlType.Clear(); + + bool bIsHighContrast = ( true && GetDisplayBackground().GetColor().IsDark() ); + + if (aRbt2D.IsChecked()) + { + aCtlType.InsertItem(CHTYPE_LINE, + SELECT_BITMAP( BMP_LINES_2D ), + String(SchResId(STR_LINES))); + aCtlType.InsertItem(CHTYPE_AREA, + SELECT_BITMAP( BMP_AREAS_2D ), + String(SchResId(STR_AREAS))); + aCtlType.InsertItem(CHTYPE_COLUMN, + SELECT_BITMAP( BMP_COLUMNS_2D ), + String(SchResId(STR_COLUMNS))); + aCtlType.InsertItem(CHTYPE_BAR, + SELECT_BITMAP( BMP_BARS_2D ), + String(SchResId(STR_BARS))); + aCtlType.InsertItem(CHTYPE_CIRCLE, + SELECT_BITMAP( BMP_CIRCLES_2D ), + String(SchResId(STR_CIRCLES))); + aCtlType.InsertItem(CHTYPE_XY, + SELECT_BITMAP( BMP_XYSYMB_2D ), + String(SchResId(STR_XY))); + aCtlType.InsertItem(CHTYPE_NET, + SELECT_BITMAP( BMP_NET_2D ), + String(SchResId(STR_NET))); + aCtlType.InsertItem(CHTYPE_STOCK, + SELECT_BITMAP( BMP_STOCK_2 ), + String(SchResId(STR_STOCK))); + } + else + { + aCtlType.InsertItem(CHTYPE_LINE, + SELECT_BITMAP( BMP_LINES_3D ), + String(SchResId(STR_LINES))); + aCtlType.InsertItem(CHTYPE_AREA, + SELECT_BITMAP( BMP_AREAS_3D_1 ), + String(SchResId(STR_AREAS))); + aCtlType.InsertItem(CHTYPE_BAR, + SELECT_BITMAP( BMP_BARS_3D_1 ), + String(SchResId(STR_BARS))); + aCtlType.InsertItem(CHTYPE_COLUMN, + SELECT_BITMAP( BMP_COLUMNS_3D_1 ), + String(SchResId(STR_COLUMNS))); + aCtlType.InsertItem(CHTYPE_CIRCLE, + SELECT_BITMAP( BMP_CIRCLES_3D ), + String(SchResId(STR_CIRCLES))); + } + + aCtlType.Show(); + + if (nSelId > 0) + { + if (aCtlType.GetItemPos(nSelId) == VALUESET_ITEM_NOTFOUND) nSelId = aCtlType.GetItemId(0); + + aCtlType.SelectItem(nSelId); + SelectTypeHdl(&aCtlType); + } + } +} + +/************************************************************************* +|* +|* Fuellt das Varianten-Set mit Bitmaps +|* +\************************************************************************/ + +void SchDiagramTypeDlg::FillVariantSet(USHORT nType) +{ + long nDefaultOffset = 0; + + aCtlVariant.Clear(); + + bool bIsHighContrast = ( true && GetDisplayBackground().GetColor().IsDark() ); + + if (eDimension == CHDIM_3D) + { + switch (nType) + { + case CHTYPE_LINE: + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_STRIPE + 1, + SELECT_BITMAP( BMP_LINES_3D ), + String(SchResId(STR_DEEP))); + break; + + case CHTYPE_AREA: + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_STACKEDAREA + 1, + SELECT_BITMAP( BMP_AREAS_3D_1 ), + String(SchResId(STR_STACKED))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_PERCENTAREA + 1, + SELECT_BITMAP( BMP_AREAS_3D_2 ), + String(SchResId(STR_PERCENT))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_AREA + 1, + SELECT_BITMAP( BMP_AREAS_3D ), + String(SchResId(STR_DEEP))); + break; + + case CHTYPE_COLUMN: + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_FLATCOLUMN + 1, + SELECT_BITMAP( BMP_COLUMNS_3D_1 ), + String(SchResId(STR_NORMAL))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_STACKEDFLATCOLUMN + 1, + SELECT_BITMAP( BMP_COLUMNS_3D_2 ), + String(SchResId(STR_STACKED))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_PERCENTFLATCOLUMN + 1, + SELECT_BITMAP( BMP_COLUMNS_3D_3 ), + String(SchResId(STR_PERCENT))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_COLUMN + 1, + SELECT_BITMAP( BMP_COLUMNS_3D ), + String(SchResId(STR_DEEP))); + + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_FLATCOLUMN + 1 + OFFSET_ROUND, + SELECT_BITMAP( BMP_SAEULE_3D_1 ), + String(SchResId(STR_SAEULE_3D_1))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_STACKEDFLATCOLUMN + 1 + OFFSET_ROUND, + SELECT_BITMAP( BMP_SAEULE_3D_2 ), + String(SchResId(STR_SAEULE_3D_2))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_PERCENTFLATCOLUMN + 1 + OFFSET_ROUND, + SELECT_BITMAP( BMP_SAEULE_3D_3 ), + String(SchResId(STR_SAEULE_3D_3))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_COLUMN + 1 + OFFSET_ROUND, + SELECT_BITMAP( BMP_SAEULE_3D_4 ), + String(SchResId(STR_SAEULE_3D_4))); + + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_FLATCOLUMN + 1 + OFFSET_PYRAMID, + SELECT_BITMAP( BMP_PYRAMID_3D_1 ), + String(SchResId(STR_PYRAMID_3D_1))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_STACKEDFLATCOLUMN + 1 + OFFSET_PYRAMID, + SELECT_BITMAP( BMP_PYRAMID_3D_2 ), + String(SchResId(STR_PYRAMID_3D_2))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_PERCENTFLATCOLUMN + 1 + OFFSET_PYRAMID, + SELECT_BITMAP( BMP_PYRAMID_3D_3 ), + String(SchResId(STR_PYRAMID_3D_3))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_COLUMN + 1 + OFFSET_PYRAMID, + SELECT_BITMAP( BMP_PYRAMID_3D_4 ), + String(SchResId(STR_PYRAMID_3D_4))); + + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_FLATCOLUMN + 1 + OFFSET_CONE, + SELECT_BITMAP( BMP_KEGEL_3D_1 ), + String(SchResId(STR_KEGEL_3D_1))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_STACKEDFLATCOLUMN + 1 + OFFSET_CONE, + SELECT_BITMAP( BMP_KEGEL_3D_2 ), + String(SchResId(STR_KEGEL_3D_2))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_PERCENTFLATCOLUMN + 1 + OFFSET_CONE, + SELECT_BITMAP( BMP_KEGEL_3D_3 ), + String(SchResId(STR_KEGEL_3D_3))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_COLUMN + 1 + OFFSET_CONE, + SELECT_BITMAP( BMP_KEGEL_3D_4 ), + String(SchResId(STR_KEGEL_3D_4))); + break; + + case CHTYPE_CIRCLE: + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_PIE + 1, + SELECT_BITMAP( BMP_CIRCLES_3D ), + String(SchResId(STR_NORMAL))); + break; + + case CHTYPE_BAR: + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_FLATBAR + 1, + SELECT_BITMAP( BMP_BARS_3D_1 ), + String(SchResId(STR_NORMAL))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_STACKEDFLATBAR + 1, + SELECT_BITMAP( BMP_BARS_3D_2 ), + String(SchResId(STR_STACKED))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_PERCENTFLATBAR + 1, + SELECT_BITMAP( BMP_BARS_3D_3 ), + String(SchResId(STR_PERCENT))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_BAR + 1, + SELECT_BITMAP( BMP_BARS_3D ), + String(SchResId(STR_DEEP))); + + + + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_FLATBAR + 1 + OFFSET_ROUND, + SELECT_BITMAP( BMP_ROEHRE_3D_1 ), + String(SchResId(STR_ROEHRE_3D_1))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_STACKEDFLATBAR + 1 + OFFSET_ROUND, + SELECT_BITMAP( BMP_ROEHRE_3D_2 ), + String(SchResId(STR_ROEHRE_3D_2))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_PERCENTFLATBAR + 1 + OFFSET_ROUND, + SELECT_BITMAP( BMP_ROEHRE_3D_3 ), + String(SchResId(STR_ROEHRE_3D_3))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_BAR + 1 + OFFSET_ROUND, + SELECT_BITMAP( BMP_ROEHRE_3D_4 ), + String(SchResId(STR_ROEHRE_3D_4))); + + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_FLATBAR + 1 + OFFSET_PYRAMID, + SELECT_BITMAP( BMP_PYRAMIDQ_3D_1 ), + String(SchResId(STR_PYRAMIDQ_3D_1))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_STACKEDFLATBAR + 1 + OFFSET_PYRAMID, + SELECT_BITMAP( BMP_PYRAMIDQ_3D_2 ), + String(SchResId(STR_PYRAMIDQ_3D_2))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_PERCENTFLATBAR + 1 + OFFSET_PYRAMID, + SELECT_BITMAP( BMP_PYRAMIDQ_3D_3 ), + String(SchResId(STR_PYRAMIDQ_3D_3))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_BAR + 1 + OFFSET_PYRAMID, + SELECT_BITMAP( BMP_PYRAMIDQ_3D_4 ), + String(SchResId(STR_PYRAMIDQ_3D_4))); + + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_FLATBAR + 1 + OFFSET_CONE, + SELECT_BITMAP( BMP_KEGELQ_3D_1 ), + String(SchResId(STR_KEGELQ_3D_1))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_STACKEDFLATBAR + 1 + OFFSET_CONE, + SELECT_BITMAP( BMP_KEGELQ_3D_2 ), + String(SchResId(STR_KEGELQ_3D_2))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_PERCENTFLATBAR + 1 + OFFSET_CONE, + SELECT_BITMAP( BMP_KEGELQ_3D_3 ), + String(SchResId(STR_KEGELQ_3D_3))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_3D_BAR + 1 + OFFSET_CONE, + SELECT_BITMAP( BMP_KEGELQ_3D_4 ), + String(SchResId(STR_KEGELQ_3D_4))); + break; + + } + } + else // 2D types + { + switch (nType) + { + case CHTYPE_LINE: + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_LINE + 1, + SELECT_BITMAP( BMP_LINES_2D_1 ), + String(SchResId(STR_NORMAL))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_STACKEDLINE + 1, + SELECT_BITMAP( BMP_LINES_2D_2 ), + String(SchResId(STR_STACKED))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_PERCENTLINE + 1, + SELECT_BITMAP( BMP_LINES_2D_3 ), + String(SchResId(STR_PERCENT))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_LINESYMBOLS + 1, + SELECT_BITMAP( BMP_LINESYMB_2D_1 ), + String(SchResId(STR_SYMBOL))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_STACKEDLINESYM + 1, + SELECT_BITMAP( BMP_LINESYMB_2D_2 ), + String(SchResId(STR_SYMBOL_STACK))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_PERCENTLINESYM + 1, + SELECT_BITMAP( BMP_LINESYMB_2D_3 ), + String(SchResId(STR_SYMBOL_PERCENT))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_CUBIC_SPLINE + 1, + SELECT_BITMAP( BMP_SPLINE_CUBIC ), + String(SchResId(STR_SPLINE_CUBIC))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_CUBIC_SPLINE_SYMBOL + 1, + SELECT_BITMAP( BMP_SPLINE_CUBIC_SYMBOL ), + String(SchResId(STR_SPLINE_CUBIC_SYMBOL))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_B_SPLINE + 1, + SELECT_BITMAP( BMP_SPLINE_B ), + String(SchResId(STR_SPLINE_B))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_B_SPLINE_SYMBOL + 1, + SELECT_BITMAP( BMP_SPLINE_B_SYMBOL ), + String(SchResId(STR_SPLINE_B_SYMBOL))); + break; + + case CHTYPE_AREA: + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_AREA + 1, + SELECT_BITMAP( BMP_AREAS_2D_1 ), + String(SchResId(STR_NORMAL))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_STACKEDAREA + 1, + SELECT_BITMAP( BMP_AREAS_2D ), + String(SchResId(STR_STACKED))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_PERCENTAREA + 1, + SELECT_BITMAP( BMP_AREAS_2D_3 ), + String(SchResId(STR_PERCENT))); + nDefaultOffset = 1; + break; + + case CHTYPE_COLUMN: + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_COLUMN + 1, + SELECT_BITMAP( BMP_COLUMNS_2D_1 ), + String(SchResId(STR_NORMAL))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_STACKEDCOLUMN + 1, + SELECT_BITMAP( BMP_COLUMNS_2D_2 ), + String(SchResId(STR_STACKED))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_PERCENTCOLUMN + 1, + SELECT_BITMAP( BMP_COLUMNS_2D_3 ), + String(SchResId(STR_PERCENT))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_LINE_COLUMN + 1, + SELECT_BITMAP( BMP_COLUMNS_2D_4 ), + String(SchResId(STR_LINE_COLUMN))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_LINE_STACKEDCOLUMN + 1, + SELECT_BITMAP( BMP_COLUMNS_2D_5 ), + String(SchResId(STR_LINE_STACKEDCOLUMN))); + + break; + + case CHTYPE_BAR: + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_BAR + 1, + SELECT_BITMAP( BMP_BARS_2D_1 ), + String(SchResId(STR_NORMAL))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_STACKEDBAR + 1, + SELECT_BITMAP( BMP_BARS_2D_2 ), + String(SchResId(STR_STACKED))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_PERCENTBAR + 1, + SELECT_BITMAP( BMP_BARS_2D_3 ), + String(SchResId(STR_PERCENT))); + break; + + case CHTYPE_CIRCLE: + { + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_PIE + 1, + SELECT_BITMAP( BMP_CIRCLES_2D ), + String(SchResId(STR_NORMAL))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_DONUT1 + 1, + SELECT_BITMAP( BMP_DONUT1_2D ), + String(SchResId(STR_DONUT1))); + String aResStr( SchResId( STR_OFS )); + String aOfsStr = aResStr; + + xub_StrLen nFound = aResStr.SearchAscii( "$(N)" ); + if( nFound != STRING_NOTFOUND ) + aOfsStr.Replace( nFound, RTL_CONSTASCII_LENGTH( "$(N)" ), String::CreateFromInt32( 1 )); + + aCtlVariant.InsertItem( (USHORT)CHSTYLE_2D_PIE_SEGOF1 + 1, + SELECT_BITMAP( BMP_CIRCLES_2D_1 ), + aOfsStr ); + + aOfsStr = aResStr; + if( nFound != STRING_NOTFOUND ) + aOfsStr.Replace( nFound, RTL_CONSTASCII_LENGTH( "$(N)" ), String::CreateFromInt32( 2 )); + + aCtlVariant.InsertItem( (USHORT)CHSTYLE_2D_PIE_SEGOFALL + 1, + SELECT_BITMAP( BMP_CIRCLES_2D_2 ), + aOfsStr ); + break; + } + + case CHTYPE_XY: + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_XYSYMBOLS + 1, + SELECT_BITMAP( BMP_XYSYMB_2D ), + String(SchResId(STR_ONLY_SYMBOLS))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_XY + 1, + SELECT_BITMAP( BMP_XY_2D ), + String(SchResId(STR_LINE_SYMBOLS))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_XY_LINE + 1, + SELECT_BITMAP( BMP_LINES_2D_1 ), + String(SchResId(STR_ONLY_LINES))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_CUBIC_SPLINE_XY + 1, + SELECT_BITMAP( BMP_SPLINE_CUBIC ), + String(SchResId(STR_SPLINE_CUBIC))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_CUBIC_SPLINE_SYMBOL_XY + 1, + SELECT_BITMAP( BMP_SPLINE_CUBIC_SYMBOL ), + String(SchResId(STR_SPLINE_CUBIC_SYMBOL))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_B_SPLINE_XY + 1, + SELECT_BITMAP( BMP_SPLINE_B ), + String(SchResId(STR_SPLINE_B))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_B_SPLINE_SYMBOL_XY + 1, + SELECT_BITMAP( BMP_SPLINE_B_SYMBOL ), + String(SchResId(STR_SPLINE_B_SYMBOL))); + break; + case CHTYPE_NET: + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_NET + 1, + SELECT_BITMAP( BMP_NET_2D ), + String(SchResId(STR_NORMAL))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_NET_STACK + 1, + SELECT_BITMAP( BMP_NET_2D_STACK ), + String(SchResId(STR_STACKED))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_NET_PERCENT + 1, + SELECT_BITMAP( BMP_NET_2D_PERCENT ), + String(SchResId(STR_PERCENT))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_NET_SYMBOLS + 1, + SELECT_BITMAP( BMP_NETSYMB_2D ), + String(SchResId(STR_SYMBOL))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_NET_SYMBOLS_STACK + 1, + SELECT_BITMAP( BMP_NETSYMB_2D_STACK ), + String(SchResId(STR_SYMBOL_STACK))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_NET_SYMBOLS_PERCENT + 1, + SELECT_BITMAP( BMP_NETSYMB_2D_PERCENT ), + String(SchResId(STR_SYMBOL_PERCENT))); + break; + + case CHTYPE_STOCK: + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_STOCK_1 + 1, + SELECT_BITMAP( BMP_STOCK_1 ), + String(SchResId(STR_STOCK_1))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_STOCK_2 + 1, + SELECT_BITMAP( BMP_STOCK_2 ), + String(SchResId(STR_STOCK_2))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_STOCK_3 + 1, + SELECT_BITMAP( BMP_STOCK_3 ), + String(SchResId(STR_STOCK_3))); + aCtlVariant.InsertItem((USHORT)CHSTYLE_2D_STOCK_4 + 1, + SELECT_BITMAP( BMP_STOCK_4 ), + String(SchResId(STR_STOCK_4))); + nDefaultOffset = 1; + } + } + + aCtlVariant.Show(); + + USHORT nSelId = aCtlVariant.GetItemId(0); + const SfxPoolItem *pPoolItem = NULL; + + if( rOutAttrs.GetItemState(SCHATTR_DIAGRAM_STYLE, TRUE, &pPoolItem) == SFX_ITEM_SET ) + { + USHORT nId = (USHORT)((const SvxChartStyleItem*)pPoolItem)->GetValue() + 1; + + if( aCtlVariant.GetItemPos(nId) != VALUESET_ITEM_NOTFOUND ) + { + nSelId = nId; + nDefaultOffset = 0; + } + } + long nShape3dOffset = 0; + if( rOutAttrs.GetItemState(SCHATTR_STYLE_SHAPE, TRUE, &pPoolItem) == SFX_ITEM_SET ) + { +// long nId3D = ((const SfxInt32Item*)&pPoolItem)->GetValue(); + switch( n3DGeometry ) + { + case CHART_SHAPE3D_CYLINDER: + nShape3dOffset = OFFSET_ROUND; + break; + case CHART_SHAPE3D_CONE: + nShape3dOffset = OFFSET_CONE; + break; + case CHART_SHAPE3D_PYRAMID: + nShape3dOffset = OFFSET_PYRAMID; + break; + } + } + if( aCtlVariant.GetItemPos( nSelId + nShape3dOffset + nDefaultOffset ) != VALUESET_ITEM_NOTFOUND ) + nSelId += (nShape3dOffset + nDefaultOffset); + + aCtlVariant.SelectItem( nSelId ); + + // make selected Item visible + aCtlVariant.SetFirstLine( aCtlVariant.GetItemPos( aCtlVariant.GetSelectItemId() ) / aCtlVariant.GetColCount() ); + + SwitchDepth( nSelId - 1 ); + SwitchNumLines( nSelId - 1 ); +} + +/************************************************************************* +|* +|* Select-Hdl der Dimensions-Buttons +|* +\************************************************************************/ + +IMPL_LINK( SchDiagramTypeDlg, SelectDimensionHdl, void *, EMPTYARG ) +{ + FillTypeSet(aRbt3D.IsChecked() ? CHDIM_3D : CHDIM_2D); + return 0; +} + +/************************************************************************* +|* +|* Select-Hdl des ValueSets +|* +\************************************************************************/ + +IMPL_LINK( SchDiagramTypeDlg, SelectTypeHdl, void *, EMPTYARG ) +{ + FillVariantSet(aCtlType.GetSelectItemId()); + return 0; +} + +/************************************************************************* +|* +|* Select-Hdl des ValueSets +|* +\************************************************************************/ + +IMPL_LINK( SchDiagramTypeDlg, DoubleClickHdl, void *, EMPTYARG ) +{ + EndDialog(RET_OK); + return 0; +} + +/************************************************************************* +|* +|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen +|* +\*************************************************************************/ + +void SchDiagramTypeDlg::GetAttr(SfxItemSet& rOutAttrs) +{ + long nId=aCtlVariant.GetSelectItemId() - 1; + long nGeo=CHART_SHAPE3D_ANY; + if(nId>OFFSET_CONE) + { + nId-=OFFSET_CONE; + nGeo=CHART_SHAPE3D_CONE; + } + if(nId>OFFSET_ROUND) + { + nId-=OFFSET_ROUND; + nGeo=CHART_SHAPE3D_CYLINDER; + } + if(nId>OFFSET_PYRAMID) + { + nId-=OFFSET_PYRAMID; + nGeo=CHART_SHAPE3D_PYRAMID; + } + if(nGeo != n3DGeometry) + rOutAttrs.Put(SfxInt32Item(SCHATTR_STYLE_SHAPE,nGeo)); + else + rOutAttrs.ClearItem(SCHATTR_STYLE_SHAPE); + + rOutAttrs.Put(SvxChartStyleItem((SvxChartStyle) (nId))); + + rOutAttrs.Put( SfxInt32Item( SCHATTR_NUM_OF_LINES_FOR_BAR, aMtrFldNumLines.GetValue())); + rOutAttrs.Put( SfxInt32Item( SCHATTR_SPLINE_RESOLUTION, aMtrFldGran.GetValue())); + rOutAttrs.Put( SfxInt32Item( SCHATTR_SPLINE_ORDER, aMtrFldDeep.GetValue())); +} + +/************************************************************************* +|* +|* Gibt die eingestellte Intensitaet als double zurueck +|* +\************************************************************************/ + +// int SchDiagramTypeDlg::GetDepth() +// { +// return aMtrFldDeep.GetValue(); +// } + +/************************************************************************* +|* +|* Setzt die uebergebene Intensitaet +|* +\************************************************************************/ + +// void SchDiagramTypeDlg::SetDepth( int nDepth ) +// { +// aMtrFldDeep.SetValue( nDepth ); +// } + +/************************************************************************* +|* +|* Setzt die uebergebene Intensitaet +|* +\************************************************************************/ + +void SchDiagramTypeDlg::SwitchDepth (USHORT nID) +{ + aFtDeep.Hide (); + aMtrFldDeep.Hide (); + aFtGran.Hide (); + aMtrFldGran.Hide (); + + switch (nID) + { + case CHSTYLE_2D_B_SPLINE : + case CHSTYLE_2D_B_SPLINE_SYMBOL : + case CHSTYLE_2D_B_SPLINE_XY : + case CHSTYLE_2D_B_SPLINE_SYMBOL_XY : + aFtDeep.Show (); + aMtrFldDeep.Show (); + + case CHSTYLE_2D_CUBIC_SPLINE : + case CHSTYLE_2D_CUBIC_SPLINE_SYMBOL : + case CHSTYLE_2D_CUBIC_SPLINE_XY : + case CHSTYLE_2D_CUBIC_SPLINE_SYMBOL_XY : + aFtGran.Show (); + aMtrFldGran.Show (); + break; + + default : + break; + } +} + +/************************************************************************* +|* +|* Select-Hdl des ValueSets +|* +\************************************************************************/ + +IMPL_LINK( SchDiagramTypeDlg, ClickHdl, void *, EMPTYARG ) +{ + SwitchDepth (aCtlVariant.GetSelectItemId() - 1); + SwitchNumLines( aCtlVariant.GetSelectItemId() - 1 ); + return 0; +} + +/************************************************************************* +|* +|* Laedt die Splineaufloesung +|* +\************************************************************************/ + +// int SchDiagramTypeDlg::GetGranularity() +// { +// return aMtrFldGran.GetValue(); +// } + +/************************************************************************* +|* +|* Setzt die Splineaufloesung +|* +\************************************************************************/ + +// void SchDiagramTypeDlg::SetGranularity( int nGranularity ) +// { +// aMtrFldGran.SetValue( nGranularity ); +// } + +void SchDiagramTypeDlg::FillValueSets() +{ + // type category (2d or 3d) + FillTypeSet( eDimension, true /* force change */ ); + + // sub-type + USHORT nId = aCtlType.GetSelectItemId(); + if( nId != 0 ) + { + FillVariantSet( nId ); + } +} + +void SchDiagramTypeDlg::DataChanged( const DataChangedEvent& rDCEvt ) +{ + ModalDialog::DataChanged( rDCEvt ); + + if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) + FillValueSets(); +} + + +void SchDiagramTypeDlg::SwitchNumLines( USHORT nID ) +{ + switch( nID ) + { + case CHSTYLE_2D_LINE_COLUMN: + case CHSTYLE_2D_LINE_STACKEDCOLUMN: + aFtNumLines.Show(); + aMtrFldNumLines.Show(); + break; + + default: + aFtNumLines.Hide(); + aMtrFldNumLines.Hide(); + break; + } +} + +void SchDiagramTypeDlg::SetMaximumNumberOfLines( long nMaxLines ) +{ + aMtrFldNumLines.SetLast( nMaxLines ); + aMtrFldNumLines.SetMax( nMaxLines ); +} + +// void SchDiagramTypeDlg::SetNumberOfLines( long nLines ) +// { +// aMtrFldNumLines.SetValue( nLines ); +// } + +// long SchDiagramTypeDlg::GetNumberOfLines() const +// { +// return aMtrFldNumLines.GetValue(); +// } + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/dialogs/dlg_ChartType.hrc b/chart2/source/controller/dialogs/dlg_ChartType.hrc new file mode 100644 index 000000000000..244fb58d7302 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_ChartType.hrc @@ -0,0 +1,78 @@ +/************************************************************************* + * + * $RCSfile: dlg_ChartType.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#define DLG_DIAGRAM_TYPE 743 +#define BTN_OK 1 +#define BTN_CANCEL 1 +#define BTN_HELP 1 +#define BTN_OPTIONS 1 +#define FL_DIMENSION 1 +#define RBT_2D 1 +#define RBT_3D 2 +#define FT_TYPE 1 +#define FT_VARIANT 2 +#define FT_DEEP 3 +#define FT_GRAN 4 +#define FT_NUM_OF_LINES 5 +#define CTL_TYPE 1 +#define CTL_VARIANT 2 +#define MTR_FLD_DEEP 1 +#define MTR_FLD_GRAN 2 +#define MTR_FLD_NUM_OF_LINES 3 diff --git a/chart2/source/controller/dialogs/dlg_ChartType.src b/chart2/source/controller/dialogs/dlg_ChartType.src new file mode 100644 index 000000000000..4947845a7fb2 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_ChartType.src @@ -0,0 +1,482 @@ +/************************************************************************* + * + * $RCSfile: dlg_ChartType.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/* +#include "diagrtyp.hrc" +#ifndef _SVX_SVXIDS_HRC +#include <svx/svxids.hrc> +#endif +#include "app.hrc" +#include "schhids.h" +*/ + +#include "dlg_ChartType.hrc" +#include "SchSlotIds.hxx" +#include "HelpIds.hrc" + +ModalDialog DLG_DIAGRAM_TYPE +{ + HelpID = SID_DIAGRAM_TYPE ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 260 , 246 ) ; + Text = "Diagrammtyp" ; + Text [ ENGLISH ] = "Diagram Type" ; + Text [ NORWEGIAN ] = "Diagram Type" ; + Text [ DANISH ] = "Diagramtype" ; + Text [ ENGLISH_US ] = "Chart Type" ; + Text [ SPANISH ] = "Tipo de diagrama" ; + Text [ FINNISH ] = "Kaaviotyyppi" ; + Text [ FRENCH ] = "Type de diagramme" ; + Text [ ITALIAN ] = "Tipo di diagramma" ; + Text [ DUTCH ] = "Diagramtype" ; + Text [ PORTUGUESE_BRAZILIAN ] = "Tipo de Grfico" ; + Text [ SWEDISH ] = "Diagramtyp" ; + Text [ PORTUGUESE ] = "Tipo de grfico" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + OKButton BTN_OK + { + Pos = MAP_APPFONT ( 204 , 6 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + DefButton = TRUE ; + }; + CancelButton BTN_CANCEL + { + Pos = MAP_APPFONT ( 204 , 23 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + HelpButton BTN_HELP + { + Pos = MAP_APPFONT ( 204 , 43 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + }; + FixedLine FL_DIMENSION + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 100 , 8 ) ; + Text = "Diagrammkategorie" ; + Text [ ENGLISH ] = "Dimension" ; + Text [ NORWEGIAN ] = "Dimension" ; + Text [ DANISH ] = "Diagramkategori" ; + Text [ ENGLISH_US ] = "Chart category" ; + Text [ SPANISH ] = "Categora de diagrama" ; + Text [ FINNISH ] = "Kaavioluokka" ; + Text [ FRENCH ] = "Catgorie" ; + Text [ ITALIAN ] = "Categoria diagramma" ; + Text [ DUTCH ] = "Diagramcategorie" ; + Text [ PORTUGUESE_BRAZILIAN ] = "Categoria de grfico" ; + Text [ SWEDISH ] = "Diagramkategori" ; + Text [ PORTUGUESE ] = "Categoria de grfico" ; + Text[ chinese_simplified ] = "图表分类"; + Text[ russian ] = " "; + Text[ polish ] = "Kategoria wykresu"; + Text[ japanese ] = "次元"; + Text[ language_user1 ] = " "; + Text[ chinese_traditional ] = "圖表分類"; + Text[ arabic ] = ""; + Text[ greek ] = " "; + Text[ korean ] = "차트 범주"; + Text[ turkish ] = "izelge kategorisi"; + Text[ catalan ] = "Dimensi"; + Text[ thai ] = "มิติ"; + Text[ czech ] = "Kategorie grafu"; + Text[ hebrew ] = "Diagrammkategorie"; + Text[ hindi ] = "चार्ट वर्ग"; + Text[ slovak ] = "Kategória grafu"; + }; + RadioButton RBT_2D + { + Pos = MAP_APPFONT ( 12 , 14 ) ; + Size = MAP_APPFONT ( 88 , 12 ) ; + Text = "~2D" ; + Text [ ENGLISH ] = "~2D" ; + Text [ NORWEGIAN ] = "~2D" ; + Text [ DANISH ] = "2D" ; + Text [ ENGLISH_US ] = "~2D" ; + Text [ SPANISH ] = "~2D" ; + Text [ FINNISH ] = "~Kaksiulotteinen" ; + Text [ FRENCH ] = "~2D" ; + Text [ ITALIAN ] = "2D" ; + Text [ DUTCH ] = "~2D" ; + Text [ PORTUGUESE_BRAZILIAN ] = "~2D" ; + Text [ SWEDISH ] = "~2D" ; + Text [ PORTUGUESE ] = "~2D" ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "~2 维"; + Text[ russian ] = ""; + Text[ polish ] = "~2D"; + Text[ japanese ] = "~2D"; + Text[ chinese_traditional ] = "平面"; + Text[ arabic ] = ""; + Text[ greek ] = "~2"; + Text[ korean ] = "2D"; + Text[ turkish ] = "~2B"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~2D"; + Text[ thai ] = "~2มิติ"; + Text[ czech ] = "2D"; + Text[ hebrew ] = "~2D"; + Text[ hindi ] = "~2D"; + Text[ slovak ] = "~2D"; + }; + RadioButton RBT_3D + { + Pos = MAP_APPFONT ( 12 , 30 ) ; + Size = MAP_APPFONT ( 88 , 12 ) ; + Text = "~3D" ; + Text [ ENGLISH ] = "~3D" ; + Text [ NORWEGIAN ] = "~3D" ; + Text [ DANISH ] = "3D" ; + Text [ ENGLISH_US ] = "~3D" ; + Text [ SPANISH ] = "~3D" ; + Text [ FINNISH ] = "~Kolmiulotteinen" ; + Text [ FRENCH ] = "~3D" ; + Text [ ITALIAN ] = "3D" ; + Text [ DUTCH ] = "~3D" ; + Text [ PORTUGUESE_BRAZILIAN ] = "~3D" ; + Text [ SWEDISH ] = "~3D" ; + Text [ PORTUGUESE ] = "~3D" ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "~3 维"; + Text[ russian ] = ""; + Text[ polish ] = "~3D"; + Text[ japanese ] = "~3D"; + Text[ chinese_traditional ] = "~3D"; + Text[ arabic ] = ""; + Text[ greek ] = "~3"; + Text[ korean ] = "3D"; + Text[ turkish ] = "~3B"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~3D"; + Text[ thai ] = "~3มิติ"; + Text[ czech ] = "3D"; + Text[ hebrew ] = "~3D"; + Text[ hindi ] = "~3D"; + Text[ slovak ] = "~3D"; + }; + FixedText FT_TYPE + { + Pos = MAP_APPFONT ( 6 , 48 ) ; + Size = MAP_APPFONT ( 192 , 10 ) ; + Text = "~Diagrammtyp" ; + Text [ ENGLISH ] = "~Type" ; + Text [ NORWEGIAN ] = "~Type:" ; + Text [ DANISH ] = "~Diagramtype" ; + Text [ ENGLISH_US ] = "Chart ~type" ; + Text [ SPANISH ] = "~Tipo de diagrama:" ; + Text [ FINNISH ] = "Kaaviot~yyppi" ; + Text [ FRENCH ] = "Type" ; + Text [ ITALIAN ] = "~Tipo diagramma" ; + Text [ DUTCH ] = "~Diagramtype" ; + Text [ PORTUGUESE_BRAZILIAN ] = "~Tipo de grfico" ; + Text [ SWEDISH ] = "~Diagramtyp:" ; + Text [ PORTUGUESE ] = "~Tipo de grfico" ; + Text[ chinese_simplified ] = "图表类型(~T)"; + Text[ russian ] = " "; + Text[ polish ] = "~Typ wykresu"; + Text[ japanese ] = "種類(~T)"; + Text[ chinese_traditional ] = "圖表類型(~T)"; + Text[ arabic ] = ":"; + Text[ greek ] = " ~"; + Text[ korean ] = "차트 유형(~T)"; + Text[ turkish ] = "Karakter ~tipi"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Tipus:"; + Text[ thai ] = "~ชนิด:"; + Text[ czech ] = "Typ grafu"; + Text[ hebrew ] = "~Diagrammtyp"; + Text[ hindi ] = "चार्ट वर्ग"; + Text[ slovak ] = "~Typ grafu"; + }; + Control CTL_TYPE + { + HelpId = HID_SCH_CTL_TYPE ; + Border = TRUE ; + Hide = TRUE ; + Pos = MAP_APPFONT ( 6 , 61 ) ; + Size = MAP_APPFONT ( 188 , 97 ) ; + TabStop = TRUE ; + }; + FixedText FT_VARIANT + { + Pos = MAP_APPFONT ( 6 , 169 ) ; + Size = MAP_APPFONT ( 192 , 10 ) ; + Text = "~Variante:" ; + Text [ ENGLISH ] = "~Variant:" ; + Text [ NORWEGIAN ] = "~Variant:" ; + Text [ DANISH ] = "Undertype:" ; + Text [ ENGLISH_US ] = "~Variants:" ; + Text [ SPANISH ] = "~Variante:" ; + Text [ FINNISH ] = "~Vaihtoehdot:" ; + Text [ FRENCH ] = "~Variante :" ; + Text [ ITALIAN ] = "~Varianti:" ; + Text [ DUTCH ] = "~Variantie:" ; + Text [ PORTUGUESE_BRAZILIAN ] = "~Variantes:" ; + Text [ SWEDISH ] = "~Variant:" ; + Text [ PORTUGUESE ] = "Variantes:" ; + Text[ chinese_simplified ] = "变体(~V)"; + Text[ russian ] = ":"; + Text[ polish ] = "~Warianty:"; + Text[ japanese ] = "バリエーション(~V):"; + Text[ chinese_traditional ] = "變體(~V)"; + Text[ arabic ] = " :"; + Text[ greek ] = ":"; + Text[ korean ] = "변수(~V):"; + Text[ turkish ] = "~Varyant:"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Variants"; + Text[ thai ] = "~ตัวแปรผัน:"; + Text[ czech ] = "Varianty:"; + Text[ hebrew ] = "~Variante:"; + Text[ hindi ] = "~वेरिएन्ट्स::"; + Text[ slovak ] = "~Varianty:"; + }; + Control CTL_VARIANT + { + HelpId = HID_SCH_CTL_VARIANT ; + Border = TRUE ; + Pos = MAP_APPFONT ( 6 , 182 ) ; + Size = MAP_APPFONT ( 188 , 53 ) ; + TabStop = TRUE ; + }; + FixedText FT_DEEP + { + Pos = MAP_APPFONT ( 114 , 16 ) ; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text = "~Sttzpunktordnung" ; + Text [ ENGLISH ] = "~Order of points" ; + Text [ english_us ] = "~Data points order" ; + Text [ italian ] = "Ordine dei punti di appoggio" ; + Text [ spanish ] = "~Orden de los puntos" ; + Text [ french ] = "~Ordre des points d'appui" ; + Text [ dutch ] = "~Steunpuntordening" ; + Text [ swedish ] = "~Punktordning" ; + Text [ danish ] = "Stttepunktorden" ; + Text [ portuguese_brazilian ] = "Ordem ~dos pontos de dados" ; + Text [ portuguese ] = "Ordem dos pontos de apoio" ; + Text[ chinese_simplified ] = "数据点顺序(~D)"; + Text[ russian ] = " "; + Text[ polish ] = "Kolejno punktw ~danych"; + Text[ japanese ] = "データポイントの配列(~D)"; + Text[ chinese_traditional ] = "資料點順序(~D)"; + Text[ arabic ] = " "; + Text[ greek ] = " ~ "; + Text[ korean ] = "데이터 포인트 배열(~D)"; + Text[ turkish ] = "~Destek noktas sras"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Ordre dels punts de ~dades"; + Text[ finnish ] = "~Arvopisteiden jrjestys"; + Text[ thai ] = "ลำดับจุด~ข้อมูล"; + Text[ czech ] = "Pořadí datových bodů"; + Text[ hebrew ] = "~Stützpunktordnung"; + Text[ hindi ] = "~ड़ॉटा बिन्दु क्रम"; + Text[ slovak ] = "Poradie ~dátových bodov"; + }; + MetricField MTR_FLD_DEEP + { + Border = TRUE ; + Pos = MAP_APPFONT ( 178 , 14 ) ; + Size = MAP_APPFONT ( 20 , 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 1 ; + Maximum = 100 ; + StrictFormat = TRUE ; + Unit = FUNIT_CUSTOM ; + First = 1 ; + Last = 100 ; + SpinSize = 1 ; + }; + FixedText FT_NUM_OF_LINES + { + Pos = MAP_APPFONT ( 114 , 16 ) ; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text = "Anzahl an ~Linien" ; + Text[ ENGLISH ] = "~Number of lines" ; + Text[ english_us ] = "~Number of lines"; + Text[ portuguese ] = "~Number of lines"; + Text[ russian ] = "~Number of lines"; + Text[ greek ] = "~Number of lines"; + Text[ dutch ] = "~Number of lines"; + Text[ french ] = "Nombre de lignes"; + Text[ spanish ] = "~Nmero de lneas"; + Text[ finnish ] = "~Number of lines"; + Text[ italian ] = "~Numero di righe"; + Text[ danish ] = "~Number of lines"; + Text[ swedish ] = "Antal ~linjer"; + Text[ polish ] = "~Number of lines"; + Text[ japanese ] = "線の本数"; + Text[ korean ] = "줄 수"; + Text[ chinese_simplified ] = "线条的数目"; + Text[ chinese_traditional ] = "線條的數目(~N)"; + Text[ turkish ] = "izgi ~Says"; + Text[ arabic ] = "~Number of lines"; + Text[ czech ] = "Počet řádků"; + Text[ hebrew ] = "Anzahl an ~Linien"; + Text[ catalan ] = "~Number of lines"; + Text[ portuguese_brazilian ] = "~Number of lines"; + Text[ thai ] = "~Number of lines"; + Text[ hindi ] = "~Number of lines"; + Text[ slovak ] = "Počet ria~dkov"; + }; + MetricField MTR_FLD_NUM_OF_LINES + { + HelpId = HID_SCH_NUM_OF_LINES ; + Border = TRUE ; + Pos = MAP_APPFONT ( 178 , 14 ) ; + Size = MAP_APPFONT ( 20 , 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 1 ; + Maximum = 100 ; + StrictFormat = TRUE ; + Unit = FUNIT_CUSTOM ; + First = 1 ; + Last = 100 ; + SpinSize = 1 ; + }; + FixedText FT_GRAN + { + Pos = MAP_APPFONT ( 114 , 31 ) ; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text = "~Auflsung" ; + Text [ ENGLISH ] = "~Order of points" ; + Text [ english_us ] = "~Resolution" ; + Text [ italian ] = "Risoluzione" ; + Text [ spanish ] = "~Resolucin" ; + Text [ french ] = "~Rsolution" ; + Text [ dutch ] = "~Resolutie" ; + Text [ swedish ] = "~Upplsning" ; + Text [ danish ] = "Oplsning" ; + Text [ portuguese_brazilian ] = "~Resoluo" ; + Text [ portuguese ] = "Resoluo" ; + Text[ chinese_simplified ] = "分辨率(~R)"; + Text[ russian ] = ""; + Text[ polish ] = "~Rozdzielczo"; + Text[ japanese ] = "中間点(~R)"; + Text[ chinese_traditional ] = "解析度(~R)"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "해상도(~R)"; + Text[ turkish ] = "~znrlk"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Resoluci"; + Text[ finnish ] = "~Tarkkuus"; + Text[ thai ] = "~ความละเอียด"; + Text[ czech ] = "Rozlišení"; + Text[ hebrew ] = "~Auflösung"; + Text[ hindi ] = "~Resolution"; + Text[ slovak ] = "~Rozlíšenie"; + }; + MetricField MTR_FLD_GRAN + { + Border = TRUE ; + Pos = MAP_APPFONT ( 178 , 30 ) ; + Size = MAP_APPFONT ( 20 , 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 1 ; + Maximum = 1000 ; + StrictFormat = TRUE ; + Unit = FUNIT_CUSTOM ; + First = 1 ; + Last = 1000 ; + SpinSize = 1 ; + }; + Text[ chinese_simplified ] = "图表类型"; + Text[ russian ] = " "; + Text[ polish ] = "Typ wykresu"; + Text[ japanese ] = "グラフの種類"; + Text[ chinese_traditional ] = "圖表類型"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "차트 유형"; + Text[ turkish ] = "ema tipi"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Tipus de diagrama"; + Text[ thai ] = "ชนิดแผนภูมิ"; + Text[ czech ] = "Typ grafu"; + Text[ hebrew ] = "Diagrammtyp"; + Text[ hindi ] = "Chart Type"; + Text[ slovak ] = "Typ grafu"; +}; + + + + + + + + + + + + + + + + diff --git a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx new file mode 100644 index 000000000000..1def4b8a46e7 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx @@ -0,0 +1,173 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertAxis_Grid.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "dlg_InsertAxis_Grid.hxx" +#include "dlg_InsertAxis_Grid.hrc" + +#include "ResId.hxx" +#include "SchSfxItemIds.hxx" +#include "Strings.hrc" +#include "SchSlotIds.hxx" + +// header for class SfxBoolItem +#ifndef _SFXENUMITEM_HXX +#include <svtools/eitem.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +InsertMeterDialogData::InsertMeterDialogData() + : aPossibilityList(6) + , aExistenceList(6) +{ + for(sal_Int32 nN=6;nN--;) + aPossibilityList[nN]=true; + for(nN=6;nN--;) + aExistenceList[nN]=false; +} + +//============================== +// +// SchAxisDlg +// +//============================== + +SchAxisDlg::SchAxisDlg( Window* pWindow + , const InsertMeterDialogData& rInput, BOOL bAxisDlg ) + : + ModalDialog( pWindow, SchResId( DLG_AXIS_OR_GRID )), + + aFlPrimary( this, ResId( FL_PRIMARY_AXIS )), + aFlPrimaryGrid( this, ResId( FL_PRIMARY_GRID )), + aCbPrimaryX( this, ResId( CB_X_PRIMARY )), + aCbPrimaryY( this, ResId( CB_Y_PRIMARY )), + aCbPrimaryZ( this, ResId( CB_Z_PRIMARY )), + + aFlSecondary( this, ResId( FL_SECONDARY_AXIS )), + aFlSecondaryGrid( this, ResId( FL_SECONDARY_GRID )), + aCbSecondaryX( this, ResId( CB_X_SECONDARY )), + aCbSecondaryY( this, ResId( CB_Y_SECONDARY )), + aCbSecondaryZ( this, ResId( CB_Z_SECONDARY )), + + aPbOK( this, ResId( BTN_OK )), + aPbCancel( this, ResId( BTN_CANCEL )), + aPbHelp( this, ResId( BTN_HELP )) + + //rOutAttrs( rInAttrs ) +{ + if(!bAxisDlg) + { + SetHelpId( SID_INSERT_GRIDS ); + SetText( String( SchResId( STR_TITLE_GRID ) ) ); + + aFlPrimary.Hide(); + aFlSecondary.Hide(); + aFlPrimaryGrid.Show(); + aFlSecondaryGrid.Show(); + } + FreeResource(); + + aCbPrimaryX.Check( rInput.aExistenceList[0] ); + aCbPrimaryY.Check( rInput.aExistenceList[1] ); + aCbPrimaryZ.Check( rInput.aExistenceList[2] ); + aCbSecondaryX.Check( rInput.aExistenceList[3] ); + aCbSecondaryY.Check( rInput.aExistenceList[4] ); + aCbSecondaryZ.Check( rInput.aExistenceList[5] ); + + aCbPrimaryX.Enable( rInput.aPossibilityList[0] ); + aCbPrimaryY.Enable( rInput.aPossibilityList[1] ); + aCbPrimaryZ.Enable( rInput.aPossibilityList[2] ); + aCbSecondaryX.Enable( rInput.aPossibilityList[3] ); + aCbSecondaryY.Enable( rInput.aPossibilityList[4] ); + aCbSecondaryZ.Enable( rInput.aPossibilityList[5] ); +} + +SchAxisDlg::~SchAxisDlg() +{ +} + +void SchAxisDlg::getResult( InsertMeterDialogData& rOutput ) +{ + rOutput.aExistenceList[0]=aCbPrimaryX.IsChecked(); + rOutput.aExistenceList[1]=aCbPrimaryY.IsChecked(); + rOutput.aExistenceList[2]=aCbPrimaryZ.IsChecked(); + rOutput.aExistenceList[3]=aCbSecondaryX.IsChecked(); + rOutput.aExistenceList[4]=aCbSecondaryY.IsChecked(); + rOutput.aExistenceList[5]=aCbSecondaryZ.IsChecked(); +} + +SchGridDlg::SchGridDlg( Window* pParent, const InsertMeterDialogData& rInput ) + : SchAxisDlg( pParent, rInput, false )//rInAttrs, b3D, bNet, bSecondaryX, bSecondaryY, false ) +{ +} + +SchGridDlg::~SchGridDlg() +{ +} + +//............................................................................. +} //namespace chart +//............................................................................. + + + diff --git a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.hrc b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.hrc new file mode 100644 index 000000000000..99594d7d1b2e --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.hrc @@ -0,0 +1,82 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertAxis_Grid.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +// Axis+Grid dialogue + +#define DLG_AXIS_OR_GRID 839 + +#define FL_PRIMARY_AXIS 1 +#define FL_SECONDARY_AXIS 2 + +#define FL_PRIMARY_GRID 3 +#define FL_SECONDARY_GRID 4 + +#define CB_X_PRIMARY 1 +#define CB_Y_PRIMARY 2 +#define CB_Z_PRIMARY 3 + +#define CB_X_SECONDARY 4 +#define CB_Y_SECONDARY 5 +#define CB_Z_SECONDARY 6 + +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_HELP 3 diff --git a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.src b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.src new file mode 100644 index 000000000000..1493cb9e508a --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.src @@ -0,0 +1,434 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertAxis_Grid.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include "dlg_InsertAxis_Grid.hrc" +#include "SchSlotIds.hxx" +#include "CommonResources.hrc" + +ModalDialog DLG_AXIS_OR_GRID +{ + HelpID = SID_INSERT_AXIS ; + OutputSize = TRUE ; + SVLook = TRUE ; + //Size = MAP_APPFONT ( 160 , 99 ) ; + Size = MAP_APPFONT ( 160 , 113 ) ; + Text = "Achsen" ; + Text [ ENGLISH ] = "Axes"; + Text [ english_us ] = "Axes" ; + Moveable = TRUE ; + + FixedLine FL_PRIMARY_AXIS + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 92 , 8 ) ; + Text = "Hauptachse" ; + Text [ ENGLISH ] = "Major axis" ; + Text [ english_us ] = "Major axis" ; + Text[ portuguese ] = "Eixo principal"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "Hoofdas"; + Text[ french ] = "Axe principal"; + Text[ spanish ] = "Eje principal"; + Text[ italian ] = "Asse principale"; + Text[ danish ] = "Overordnet akse"; + Text[ swedish ] = "Huvudaxel"; + Text[ polish ] = "O gwna"; + Text[ portuguese_brazilian ] = "Eixo principal"; + Text[ japanese ] = "数値軸"; + Text[ korean ] = "주 축"; + Text[ chinese_simplified ] = "主轴"; + Text[ chinese_traditional ] = "主軸"; + Text[ arabic ] = " "; + Text[ turkish ] = "Byk eksen"; + Text[ catalan ] = "Eix principal"; + Text[ finnish ] = "Pakseli"; + Text[ thai ] = "แกนหลัก"; + Text[ czech ] = "Hlavní osa"; + Text[ hebrew ] = "Hauptachse"; + Text[ hindi ] = "Major axis"; + Text[ slovak ] = "Hlavná os"; + }; + FixedLine FL_PRIMARY_GRID + { + Hide = TRUE ; + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 92 , 8 ) ; + Text = "Hauptgitter" ; + Text [ ENGLISH ] = "Major gridlines" ; + Text [ italian ] = "Griglia principale" ; + Text [ portuguese_brazilian ] = "Grade Principal" ; + Text [ portuguese ] = "Grelha principal" ; + Text [ finnish ] = "Pruudukko" ; + Text [ danish ] = "Overordnet gitter" ; + Text [ french ] = "Grille principale" ; + Text [ swedish ] = "Huvudgitter" ; + Text [ dutch ] = "Hoofdraster" ; + Text [ spanish ] = "Cuadrcula principal" ; + Text [ english_us ] = "Main grid" ; + Text[ chinese_simplified ] = "主网格线"; + Text[ russian ] = " "; + Text[ polish ] = "Gwna siatka"; + Text[ japanese ] = "主目盛線"; + Text[ chinese_traditional ] = "主網格"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "주 눈금선"; + Text[ turkish ] = "Ana zgara"; + Text[ catalan ] = "Cuadr. principal"; + Text[ thai ] = "เส้นตารางหลัก"; + Text[ czech ] = "Hlavní mřížka"; + Text[ hebrew ] = "Hauptgitter"; + Text[ hindi ] = "प्रधान जाल"; + Text[ slovak ] = "Hlavná mriežka"; + }; + CheckBox CB_X_PRIMARY + { + Pos = MAP_APPFONT ( 12 , 14 ); + Size = MAP_APPFONT ( 80 , 10 ); + TabStop = TRUE; + Text= "~X-Achse"; + Text [ ENGLISH ] = "~X axis"; + Text [ english_us ] = "~X axis"; + Text[ portuguese ] = "Eixo ~X"; + Text[ russian ] = " ~X"; + Text[ greek ] = " X"; + Text[ dutch ] = "~X-as"; + Text[ french ] = "Axe X"; + Text[ spanish ] = "Eje ~X"; + Text[ italian ] = "Asse ~X"; + Text[ danish ] = "X-akse"; + Text[ swedish ] = "~X-axel"; + Text[ polish ] = "O ~X"; + Text[ portuguese_brazilian ] = "Eixo ~X"; + Text[ japanese ] = "~X 軸"; + Text[ korean ] = "~X 축"; + Text[ chinese_simplified ] = "~X 轴"; + Text[ chinese_traditional ] = "~X 軸"; + Text[ arabic ] = " "; + Text[ turkish ] = "~X ekseni"; + Text[ catalan ] = "Eix ~X"; + Text[ finnish ] = "X-akseli"; + Text[ thai ] = "แกน~X "; + Text[ czech ] = "Osa X"; + Text[ hebrew ] = "~X-Achse"; + Text[ hindi ] = "~X अक्ष"; + Text[ slovak ] = "Os ~X"; + }; + CheckBox CB_Y_PRIMARY + { + Pos = MAP_APPFONT ( 12 , 28 ); + Size = MAP_APPFONT ( 80 , 10 ); + TabStop = TRUE; + Text= "~Y-Achse"; + Text [ ENGLISH ] = "~Y axis"; + Text [ english_us ] = "~Y axis"; + Text[ portuguese ] = "Eixo ~Y"; + Text[ russian ] = " ~Y"; + Text[ greek ] = " ~"; + Text[ dutch ] = "~Y-as"; + Text[ french ] = "Axe ~Y"; + Text[ spanish ] = "Eje ~Y"; + Text[ italian ] = "Asse ~Y"; + Text[ danish ] = "Y-akse"; + Text[ swedish ] = "Y-axel"; + Text[ polish ] = "O ~Y"; + Text[ portuguese_brazilian ] = "Eixo ~Y"; + Text[ japanese ] = "~Y 軸"; + Text[ korean ] = "~Y 축"; + Text[ chinese_simplified ] = "~Y 轴"; + Text[ chinese_traditional ] = "~Y 軸"; + Text[ arabic ] = " "; + Text[ turkish ] = "~Y ekseni"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Eix ~Y"; + Text[ finnish ] = "Y-akseli"; + Text[ thai ] = "แกน~Y "; + Text[ czech ] = "Osa Y"; + Text[ hebrew ] = "~Y-Achse"; + Text[ hindi ] = "~Y axis"; + Text[ slovak ] = "Os ~Y"; + }; + CheckBox CB_Z_PRIMARY + { + Pos = MAP_APPFONT ( 12 , 42 ); + Size = MAP_APPFONT ( 80 , 10 ); + TabStop = TRUE; + Text= "~Z-Achse"; + Text [ ENGLISH ] = "~Z axis"; + Text [ english_us ] = "~Z axis"; + Text[ portuguese ] = "Eixo ~Z"; + Text[ russian ] = " ~Z"; + Text[ greek ] = " Z"; + Text[ dutch ] = "~Z-as"; + Text[ french ] = "Axe ~Z"; + Text[ spanish ] = "Eje ~Z"; + Text[ italian ] = "Asse ~Z"; + Text[ danish ] = "Z-akse"; + Text[ swedish ] = "Z-axel"; + Text[ polish ] = "O ~Z"; + Text[ portuguese_brazilian ] = "Eixo ~Z"; + Text[ japanese ] = "~Z 軸"; + Text[ korean ] = "~Z 축"; + Text[ chinese_simplified ] = "~Z 轴"; + Text[ chinese_traditional ] = "~Z 軸"; + Text[ arabic ] = " "; + Text[ turkish ] = "~Z ekseni"; + Text[ catalan ] = "Eix ~Z"; + Text[ finnish ] = "Z-akseli"; + Text[ thai ] = "แกน~Z "; + Text[ czech ] = "Osa Z"; + Text[ hebrew ] = "~Z-Achse"; + Text[ hindi ] = "~Z अक्ष"; + Text[ slovak ] = "Os ~Z"; + }; + + FixedLine FL_SECONDARY_AXIS + { + Pos = MAP_APPFONT ( 6 , 58 ) ; + Size = MAP_APPFONT ( 92 , 8 ) ; + Text = "Sekundre Achse" ; + Text [ ENGLISH ] = "Secondary axis" ; + Text [ english_us ] = "Secondary axis" ; + Text[ portuguese ] = "Eixo secundrio"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "Secundaire as"; + Text[ french ] = "Axe secondaire"; + Text[ spanish ] = "Eje secundario"; + Text[ italian ] = "Asse secondario"; + Text[ danish ] = "Underordnet akse"; + Text[ swedish ] = "Sekundr axel"; + Text[ polish ] = "O pomocnicza"; + Text[ portuguese_brazilian ] = "Eixo secundrio"; + Text[ japanese ] = "第2数値軸"; + Text[ korean ] = "2차 축"; + Text[ chinese_simplified ] = "次轴"; + Text[ chinese_traditional ] = "副軸"; + Text[ arabic ] = " "; + Text[ turkish ] = "kincil eksen"; + Text[ catalan ] = "Eix secundari"; + Text[ finnish ] = "Toissijainen akseli"; + Text[ thai ] = "แกนทุติยภูมิ"; + Text[ czech ] = "Sekundární osa"; + Text[ hebrew ] = "Sekundäre Achse"; + Text[ hindi ] = "दूसरा अक्ष"; + Text[ slovak ] = "Sekundárna os"; + }; + FixedLine FL_SECONDARY_GRID + { + Hide = TRUE ; + Pos = MAP_APPFONT ( 6 , 58 ) ; + Size = MAP_APPFONT ( 92 , 8 ) ; + Text = "Hilfsgitter" ; + Text [ ENGLISH ] = "Minor gridlines" ; + Text [ italian ] = "Griglia ausiliaria" ; + Text [ portuguese_brazilian ] = "Grade auxiliar" ; + Text [ portuguese ] = "Grelha auxiliar" ; + Text [ danish ] = "Underordnet gitter" ; + Text [ french ] = "Grille auxiliaire" ; + Text [ swedish ] = "Stdgitter" ; + Text [ dutch ] = "Hulpraster" ; + Text [ spanish ] = "Cuadrcula auxiliar" ; + Text [ english_us ] = "Minor grid" ; + Text[ chinese_simplified ] = "次网格线"; + Text[ russian ] = " "; + Text[ polish ] = "Pomocnicza siatka"; + Text[ japanese ] = "補助目盛線"; + Text[ chinese_traditional ] = "輔助網格"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "보조 눈금선"; + Text[ turkish ] = "Kk zgara"; + Text[ catalan ] = "Cuadr. auxiliar"; + Text[ finnish ] = "Apuruudukko"; + Text[ thai ] = "เส้นตารางรอง"; + Text[ czech ] = "Vedlejší mřížka"; + Text[ hebrew ] = "Hilfsgitter"; + Text[ hindi ] = "छोटा जाल"; + Text[ slovak ] = "Vedľajšia mriežka"; + }; + CheckBox CB_X_SECONDARY + { + Pos = MAP_APPFONT ( 12 , 69 ); + Size = MAP_APPFONT ( 80 , 10 ); + TabStop = TRUE; + Text= "X-~Achse"; + Text [ ENGLISH ] = "X ~axis"; + Text [ english_us ] = "X ~axis"; + Text[ portuguese ] = "~Eixo X"; + Text[ russian ] = "~ X"; + Text[ greek ] = " X"; + Text[ dutch ] = "X~-as"; + Text[ french ] = "Axe X"; + Text[ spanish ] = "~Eje X"; + Text[ italian ] = "~Asse X"; + Text[ danish ] = "X-akse"; + Text[ swedish ] = "X-axel"; + Text[ polish ] = "O ~X"; + Text[ portuguese_brazilian ] = "~Eixo X"; + Text[ japanese ] = "X軸(~A)"; + Text[ korean ] = "X 축(~A)"; + Text[ chinese_simplified ] = "X 轴(~A)"; + Text[ chinese_traditional ] = "X 軸(~A)"; + Text[ arabic ] = " "; + Text[ turkish ] = "X ~ekseni"; + Text[ catalan ] = "~Eix X"; + Text[ finnish ] = "X-akseli"; + Text[ thai ] = "แ~กนX "; + Text[ czech ] = "Osa X"; + Text[ hebrew ] = "X-~Achse"; + Text[ hindi ] = "X ~अक्ष"; + Text[ slovak ] = "~Os X"; + }; + CheckBox CB_Y_SECONDARY + { + Pos = MAP_APPFONT ( 12 , 83 ); + Size = MAP_APPFONT ( 80 , 10 ); + TabStop = TRUE; + Text= "Y-A~chse"; + Text [ ENGLISH ] = "Y ax~is"; + Text [ english_us ] = "Y ax~is"; + Text[ portuguese ] = "Ei~xo Y"; + Text[ russian ] = "~ Y"; + Text[ greek ] = "~ "; + Text[ dutch ] = "Y-a~s"; + Text[ french ] = "~Axe Y"; + Text[ spanish ] = "Eje Y"; + Text[ italian ] = "Asse Y"; + Text[ danish ] = "Y-akse"; + Text[ swedish ] = "Y-axel"; + Text[ polish ] = "O ~Y"; + Text[ portuguese_brazilian ] = "Ei~xo Y"; + Text[ japanese ] = "Y軸(~I)"; + Text[ korean ] = "Y 축(~I)"; + Text[ chinese_simplified ] = "Y 轴(~I)"; + Text[ chinese_traditional ] = "Y 軸(~I)"; + Text[ arabic ] = " "; + Text[ turkish ] = "Y e~kseni"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "E~ix Y"; + Text[ finnish ] = "Y-ak~seli"; + Text[ thai ] = "แก~นY "; + Text[ czech ] = "Osa Y"; + Text[ hebrew ] = "Y-A~chse"; + Text[ hindi ] = "Y अ~क्ष"; + Text[ slovak ] = "O~s Y"; + }; + CheckBox CB_Z_SECONDARY + { + Pos = MAP_APPFONT ( 12 , 97 ); + Size = MAP_APPFONT ( 80 , 10 ); + TabStop = TRUE; + Text= "Z-Ac~hse"; + Text [ ENGLISH ] = "Z axi~s"; + Text [ english_us ] = "Z axi~s"; + Text[ portuguese ] = "Eix~o Z"; + Text[ russian ] = " Z"; + Text[ greek ] = " Z"; + Text[ dutch ] = "~Z-as"; + Text[ french ] = "Ax~e Z"; + Text[ spanish ] = "Eje Z"; + Text[ italian ] = "Asse Z"; + Text[ danish ] = "Z-akse"; + Text[ swedish ] = "Z-axel"; + Text[ polish ] = "O ~Z"; + Text[ portuguese_brazilian ] = "Ei~xo Y"; + Text[ japanese ] = "Z軸(~S)"; + Text[ korean ] = "Z 축(~S)"; + Text[ chinese_simplified ] = "Z 轴(~S)"; + Text[ chinese_traditional ] = "Z 軸(~S)"; + Text[ arabic ] = " "; + Text[ turkish ] = "Z ek~seni"; + Text[ catalan ] = "Ei~x Z"; + Text[ finnish ] = "Z-ak~seli"; + Text[ thai ] = "~แกนZ "; + Text[ czech ] = "Osa Z"; + Text[ hebrew ] = "Z-Ac~hse"; + Text[ hindi ] = "Z ~अक्ष"; + Text[ slovak ] = "Os ~Z"; + }; + BUTTONS_OK_CANCEL_HELP_STACKED(104) + Text[ portuguese ] = "Eixos"; + Text[ russian ] = ""; + Text[ greek ] = ""; + Text[ dutch ] = "Assen"; + Text[ french ] = "Axes"; + Text[ spanish ] = "Ejes"; + Text[ italian ] = "Assi"; + Text[ danish ] = "Akser"; + Text[ swedish ] = "Axlar"; + Text[ polish ] = "Osie"; + Text[ portuguese_brazilian ] = "Eixos"; + Text[ japanese ] = "軸"; + Text[ korean ] = "축"; + Text[ chinese_simplified ] = "轴"; + Text[ chinese_traditional ] = "軸"; + Text[ arabic ] = ""; + Text[ turkish ] = "Eksen"; + Text[ catalan ] = "Eixos"; + Text[ finnish ] = "Akselit"; + Text[ thai ] = "แกน"; + Text[ czech ] = "Osy"; + Text[ hebrew ] = "Achsen"; + Text[ hindi ] = "अक्ष रेखा"; + Text[ slovak ] = "Osi"; +}; diff --git a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx new file mode 100644 index 000000000000..8bf57eaea466 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx @@ -0,0 +1,244 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertDataLabel.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "dlg_InsertDataLabel.hxx" +#include "dlg_InsertDataLabel.hrc" + +#include "ResId.hxx" +#include "SchSfxItemIds.hxx" + +// header for class SfxBoolItem +#ifndef _SFXENUMITEM_HXX +#include <svtools/eitem.hxx> +#endif +// header for class SvxChartDataDescrItem +#define ITEMID_CHARTDATADESCR SCHATTR_DATADESCR_DESCR +#ifndef _SVX_CHRTITEM_HXX +#include <svx/chrtitem.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +/************************************************************************* +|* +|* Dialog zum Aendern der Beschriftungen +|* +\************************************************************************/ + +SchDataDescrDlg::SchDataDescrDlg(Window* pWindow, const SfxItemSet& rInAttrs) : + ModalDialog(pWindow, SchResId(DLG_DATA_DESCR)), + aCbValue(this, ResId(CB_VALUE)), + aRbNumber(this, ResId(RB_NUMBER)), + aRbPercent(this, ResId(RB_PERCENT)), + aCbText(this, ResId(CB_TEXT)), + aFlDescr(this, ResId(FL_DESCR)), + aCbSymbol(this, ResId(CB_SYMBOL)), + aBtnOK(this, ResId(BTN_OK)), + aBtnCancel(this, ResId(BTN_CANCEL)), + aBtnHelp(this, ResId(BTN_HELP)), + rOutAttrs(rInAttrs) +{ + FreeResource(); + + aCbValue.SetClickHdl( LINK( this, SchDataDescrDlg, EnableHdl )); + aCbText.SetClickHdl( LINK( this, SchDataDescrDlg, EnableHdl )); + + Reset(); +} + +/************************************************************************* +|* +|* Dtor +|* +\************************************************************************/ + +SchDataDescrDlg::~SchDataDescrDlg() +{ +} + +/************************************************************************* +|* +|* handler for enable/disable 'show symbol' and options for value +|* +\*************************************************************************/ + +IMPL_LINK( SchDataDescrDlg, EnableHdl, CheckBox *, pControl ) +{ + aCbSymbol.Enable( aCbValue.IsChecked() || aCbText.IsChecked() ); + if( pControl == &aCbValue ) + { + aRbPercent.Enable( aCbValue.IsChecked() ); + aRbNumber.Enable( aCbValue.IsChecked() ); + } + + return 0; +} + +/************************************************************************* +|* +|* Initialisierung +|* +\*************************************************************************/ + +void SchDataDescrDlg::Reset() +{ + const SfxPoolItem *pPoolItem = NULL; + + // default state + aRbNumber.Enable( FALSE ); + aRbPercent.Enable( FALSE ); + aCbSymbol.Enable( FALSE ); + + SfxItemState aState = rOutAttrs.GetItemState(SCHATTR_DATADESCR_SHOW_SYM, TRUE, &pPoolItem); + if( aState == SFX_ITEM_SET ) + aCbSymbol.Check( ((const SfxBoolItem*)pPoolItem)->GetValue() ); + else + { + aCbSymbol.EnableTriState( TRUE ); + aCbSymbol.SetState( STATE_DONTKNOW ); + } + + aState = rOutAttrs.GetItemState(SCHATTR_DATADESCR_DESCR, TRUE, &pPoolItem); + if( aState == SFX_ITEM_SET ) + { + switch( ((const SvxChartDataDescrItem*)pPoolItem)->GetValue() ) + { + case CHDESCR_VALUE: + aCbValue.Check(); + aRbNumber.Check(); + EnableHdl( &aCbValue ); + break; + + case CHDESCR_PERCENT: + aCbValue.Check(); + aRbPercent.Check(); + EnableHdl( &aCbValue ); + break; + + case CHDESCR_TEXT: + aCbText.Check(); + EnableHdl( &aCbText ); + break; + + case CHDESCR_TEXTANDPERCENT: + aCbText.Check(); + aCbValue.Check(); + aRbPercent.Check(); + EnableHdl( &aCbValue ); + break; + + case CHDESCR_TEXTANDVALUE: + aCbText.Check(); + aCbValue.Check(); + aRbNumber.Check(); + EnableHdl( &aCbValue ); + break; + + default: + break; + } + } + else + { + aCbText.EnableTriState( TRUE ); + aCbText.SetState( STATE_DONTKNOW ); + + aCbValue.EnableTriState( TRUE ); + aCbValue.SetState( STATE_DONTKNOW ); + } + if( !aRbNumber.IsChecked() && !aRbPercent.IsChecked() ) + aRbNumber.Check(); +} + +/************************************************************************* +|* +|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen +|* +\*************************************************************************/ + +void SchDataDescrDlg::GetAttr(SfxItemSet& rOutAttrs) +{ + BOOL bText = aCbText.IsChecked(); + SvxChartDataDescr eDescr; + + if( aCbValue.IsChecked() ) + { + if( aRbNumber.IsChecked() ) + eDescr = (bText? CHDESCR_TEXTANDVALUE : CHDESCR_VALUE); + else + eDescr = (bText? CHDESCR_TEXTANDPERCENT : CHDESCR_PERCENT); + } + else if( aCbText.IsChecked() ) + eDescr = CHDESCR_TEXT; + else + eDescr = CHDESCR_NONE; + + rOutAttrs.Put(SvxChartDataDescrItem(eDescr)); + rOutAttrs.Put(SfxBoolItem( SCHATTR_DATADESCR_SHOW_SYM, + aCbSymbol.IsChecked()) ); +} + +//............................................................................. +} //namespace chart +//............................................................................. + diff --git a/chart2/source/controller/dialogs/dlg_InsertDataLabel.hrc b/chart2/source/controller/dialogs/dlg_InsertDataLabel.hrc new file mode 100644 index 000000000000..050e9d076120 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertDataLabel.hrc @@ -0,0 +1,70 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertDataLabel.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#define DLG_DATA_DESCR 836 +#define BTN_OK 1 +#define BTN_CANCEL 1 +#define BTN_HELP 1 +#define FL_DESCR 1 +#define CB_VALUE 1 +#define CB_TEXT 2 +#define CB_SYMBOL 3 +#define RB_NUMBER 1 +#define RB_PERCENT 2 diff --git a/chart2/source/controller/dialogs/dlg_InsertDataLabel.src b/chart2/source/controller/dialogs/dlg_InsertDataLabel.src new file mode 100644 index 000000000000..c5bd106ebdac --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertDataLabel.src @@ -0,0 +1,175 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertDataLabel.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include "dlg_InsertDataLabel.hrc" +#include "SchSlotIds.hxx" +#include "CommonResources.hrc" +#include "res_DataLabel.hrc" + +ModalDialog DLG_DATA_DESCR +{ + HelpID = SID_INSERT_DESCRIPTION ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 200 , 86 ) ; + Text = "Datenbeschriftung" ; + Text [ ENGLISH ] = "Data Description" ; + Text [ norwegian ] = "Data Description" ; + Text [ italian ] = "Dicitura dati" ; + Text [ portuguese_brazilian ] = "Rtulos dos Dados" ; + Text [ portuguese ] = "Legenda para dados" ; + Text [ finnish ] = "Tietoselitteet" ; + Text [ danish ] = "Dataetiketter" ; + Text [ french ] = "tiquetage des donnes" ; + Text [ swedish ] = "Dataetiketter" ; + Text [ dutch ] = "Gegevenslabels" ; + Text [ spanish ] = "Etiqueta de datos" ; + Text [ english_us ] = "Data Labels" ; + Moveable = TRUE ; + BUTTONS_OK_CANCEL_HELP_STACKED(144) + RESOURCE_DATALABEL( 12, 14 ) + FixedLine FL_DESCR + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 132 , 8 ) ; + Text = "Datenbeschriftung" ; + Text [ ENGLISH ] = "Data Description" ; + Text [ norwegian ] = "Data Description" ; + Text [ italian ] = "Dicitura dati" ; + Text [ portuguese_brazilian ] = "Rtulos de dados" ; + Text [ portuguese ] = "Etiqueta de dados" ; + Text [ finnish ] = "Tietoselitteet" ; + Text [ danish ] = "Dataetiketter" ; + Text [ french ] = "tiquetage des donnes" ; + Text [ swedish ] = "Dataetikett" ; + Text [ dutch ] = "Gegevenslabels" ; + Text [ spanish ] = "Etiqueta de datos" ; + Text [ english_us ] = "Data labels" ; + Text[ chinese_simplified ] = "数据标志"; + Text[ russian ] = " "; + Text[ polish ] = "Etykiety danych"; + Text[ japanese ] = "データラベル"; + Text[ chinese_traditional ] = "資料標籤"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "데이터 레이블"; + Text[ turkish ] = "Veri etiketleri"; + Text[ catalan ] = "Etiqueta de dades"; + Text[ thai ] = "ป้ายชื่อข้อมูล"; + Text[ czech ] = "Popisky dat"; + Text[ hebrew ] = "Datenbeschriftung"; + Text[ hindi ] = "ड़ॉटा लेबिलें"; + Text[ slovak ] = "Popisy dát"; + }; + + Text[ chinese_simplified ] = "数据标志"; + Text[ russian ] = " "; + Text[ polish ] = "Etykiety danych"; + Text[ japanese ] = "データラベル"; + Text[ chinese_traditional ] = "資料標籤"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "데이터 레이블"; + Text[ turkish ] = "Veri etiketi"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Etiquetes de dades"; + Text[ thai ] = "ป้ายชื่อข้อมูล"; + Text[ czech ] = "Popisky dat"; + Text[ hebrew ] = "Datenbeschriftung"; + Text[ hindi ] = "ड़ॉटा लेबिलें"; + Text[ slovak ] = "Popisy dát"; +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/source/controller/dialogs/dlg_InsertLegend.cxx b/chart2/source/controller/dialogs/dlg_InsertLegend.cxx new file mode 100644 index 000000000000..aa6d38f721ba --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertLegend.cxx @@ -0,0 +1,203 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertLegend.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "dlg_InsertLegend.hxx" +#include "dlg_InsertLegend.hrc" + +#include "ResId.hxx" +#include "SchSfxItemIds.hxx" + +// header for enum SvxChartLegendPos +#define ITEMID_CHARTLEGENDPOS SCHATTR_LEGEND_POS +#ifndef _SVX_CHRTITEM_HXX +#include <svx/chrtitem.hxx> +#endif +// header for class SfxItemPool +#ifndef _SFXITEMPOOL_HXX +#include <svtools/itempool.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +/************************************************************************* +|* +|* Dialog zur Ausrichtung der Legende +|* +\************************************************************************/ + +SchLegendDlg::SchLegendDlg(Window* pWindow, const SfxItemSet& rInAttrs) : + ModalDialog(pWindow, SchResId(DLG_LEGEND)), + aCbxShow(this, ResId(CBX_SHOW)), + aRbtLeft(this, ResId(RBT_LEFT)), + aRbtTop(this, ResId(RBT_TOP)), + aRbtRight(this, ResId(RBT_RIGHT)), + aRbtBottom(this, ResId(RBT_BOTTOM)), + aFlLegend(this, ResId(FL_LEGEND)), + aBtnOK(this, ResId(BTN_OK)), + aBtnCancel(this, ResId(BTN_CANCEL)), + aBtnHelp(this, ResId(BTN_HELP)), + rOutAttrs(rInAttrs) +{ + FreeResource(); + + aCbxShow.SetClickHdl (LINK(this, SchLegendDlg, CbxClick)); + + Reset(); +} + +/************************************************************************* +|* +|* Dtor +|* +/************************************************************************/ + +SchLegendDlg::~SchLegendDlg() +{ +} + +/************************************************************************* +|* +|* Initialisierung +|* +\*************************************************************************/ + +void SchLegendDlg::Reset() +{ + SvxChartLegendPos ePos = CHLEGEND_NONE; + + const SfxPoolItem* pPoolItem = NULL; + if( rOutAttrs.GetItemState( SCHATTR_LEGEND_POS, + TRUE, &pPoolItem ) != SFX_ITEM_SET ) + pPoolItem = &(rOutAttrs.GetPool()->GetDefaultItem( SCHATTR_LEGEND_POS )); + + if( pPoolItem ) + ePos = ((const SvxChartLegendPosItem*)pPoolItem)->GetValue(); + + switch( ePos ) + { + case CHLEGEND_LEFT: + aRbtLeft.Check(TRUE); + break; + case CHLEGEND_TOP: + aRbtTop.Check(TRUE); + break; + case CHLEGEND_NONE: + case CHLEGEND_RIGHT: + aRbtRight.Check(TRUE); + break; + case CHLEGEND_BOTTOM: + aRbtBottom.Check(TRUE); + break; + } + + aCbxShow.Check (ePos != CHLEGEND_NONE); + aRbtLeft.Enable (ePos != CHLEGEND_NONE); + aRbtTop.Enable (ePos != CHLEGEND_NONE); + aRbtRight.Enable (ePos != CHLEGEND_NONE); + aRbtBottom.Enable (ePos != CHLEGEND_NONE); +} + +/************************************************************************* +|* +|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen +|* +\*************************************************************************/ + +void SchLegendDlg::GetAttr(SfxItemSet& rOutAttrs) +{ + SvxChartLegendPos ePos; + + if ( ! aCbxShow.IsChecked()) + ePos = CHLEGEND_NONE; + else if (aRbtLeft.IsChecked()) + ePos = CHLEGEND_LEFT; + else if (aRbtTop.IsChecked()) + ePos = CHLEGEND_TOP; + else if (aRbtRight.IsChecked()) + ePos = CHLEGEND_RIGHT; + else if (aRbtBottom.IsChecked()) + ePos = CHLEGEND_BOTTOM; + else + ePos = CHLEGEND_NONE; + + rOutAttrs.Put(SvxChartLegendPosItem(ePos)); +} + + + + +IMPL_LINK (SchLegendDlg, CbxClick, CheckBox *, pBtn) +{ + BOOL bChecked = aCbxShow.IsChecked(); + + aRbtLeft.Enable (bChecked); + aRbtTop.Enable (bChecked); + aRbtRight.Enable (bChecked); + aRbtBottom.Enable (bChecked); + + return 0; +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/dialogs/dlg_InsertLegend.hrc b/chart2/source/controller/dialogs/dlg_InsertLegend.hrc new file mode 100644 index 000000000000..a446e2cdaf7e --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertLegend.hrc @@ -0,0 +1,70 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertLegend.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#define DLG_LEGEND 835 +#define CBX_SHOW 1 +#define FL_LEGEND 1 +#define RBT_LEFT 2 +#define RBT_TOP 3 +#define RBT_RIGHT 4 +#define RBT_BOTTOM 5 +#define BTN_OK 1 +#define BTN_CANCEL 1 +#define BTN_HELP 1 diff --git a/chart2/source/controller/dialogs/dlg_InsertLegend.src b/chart2/source/controller/dialogs/dlg_InsertLegend.src new file mode 100644 index 000000000000..8775e28cd67b --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertLegend.src @@ -0,0 +1,211 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertLegend.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include "dlg_InsertLegend.hrc" +#include "SchSlotIds.hxx" +#include "CommonResources.hrc" +#include "res_LegendPosition.hrc" + +ModalDialog DLG_LEGEND +{ + HelpID = SID_INSERT_CHART_LEGEND ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 135 , 90 ) ; + Text = "Legende" ; + Text [ ENGLISH ] = "Legend" ; + Text [ norwegian ] = "Legend" ; + Text [ italian ] = "Legenda" ; + Text [ portuguese_brazilian ] = "Legenda" ; + Text [ portuguese ] = "Legenda" ; + Text [ finnish ] = "Selite" ; + Text [ danish ] = "Forklaring" ; + Text [ french ] = "Lgende" ; + Text [ swedish ] = "Frklaring" ; + Text [ dutch ] = "Legenda" ; + Text [ spanish ] = "Leyenda" ; + Text [ english_us ] = "Legend" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + BUTTONS_OK_CANCEL_HELP_STACKED( 79 ) + FixedLine FL_LEGEND + { + Pos = MAP_APPFONT ( 6 , 21 ) ; + Size = MAP_APPFONT ( 67 , 8 ) ; + Text = "Position" ; + Text [ ENGLISH ] = "Show" ; + Text [ norwegian ] = "Show" ; + Text [ italian ] = "Posizione" ; + Text [ portuguese_brazilian ] = "Posio" ; + Text [ portuguese ] = "Posio" ; + Text [ finnish ] = "Sijainti" ; + Text [ danish ] = "Stilling" ; + Text [ french ] = "Position" ; + Text [ swedish ] = "Placering" ; + Text [ dutch ] = "Positie" ; + Text [ spanish ] = "Posicin" ; + Text [ english_us ] = "Position" ; + Text[ chinese_simplified ] = "位置"; + Text[ russian ] = ""; + Text[ polish ] = "Pozycja"; + Text[ japanese ] = "表示位置"; + Text[ chinese_traditional ] = "位置"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "표시 위치"; + Text[ turkish ] = "Konum"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Mostra"; + Text[ thai ] = "แสดงผล"; + Text[ czech ] = "Umístění"; + Text[ hebrew ] = "מיקום"; + Text[ hindi ] = "स्थान"; + Text[ slovak ] = "Umiestnenie"; + }; + CheckBox CBX_SHOW + { + Pos = MAP_APPFONT ( 6 , 6 ) ; + Size = MAP_APPFONT ( 67 , 12 ) ; + Text = "~Anzeigen" ; + Text [ ENGLISH ] = "~None" ; + Text [ norwegian ] = "~Ingen " ; + Text [ italian ] = "~Mostra" ; + Text [ portuguese_brazilian ] = "~Exibir" ; + Text [ portuguese ] = "~Mostrar" ; + Text [ finnish ] = "~Nyt" ; + Text [ danish ] = "~Vis" ; + Text [ french ] = "~Afficher" ; + Text [ swedish ] = "Vis~a" ; + Text [ dutch ] = "~Weergeven" ; + Text [ spanish ] = "~Mostrar" ; + Text [ english_us ] = "~Display" ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "显示(~D)"; + Text[ russian ] = "~"; + Text[ polish ] = "~Wywietl"; + Text[ japanese ] = "表示する(~D)"; + Text[ chinese_traditional ] = "顯示(~D)"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "표시(~D)"; + Text[ turkish ] = "~Gster"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Cap"; + Text[ thai ] = "ไ~ม่มี"; + Text[ czech ] = "Displej"; + Text[ hebrew ] = "~Anzeigen"; + Text[ hindi ] = "~दिखाओ"; + Text[ slovak ] = "~Displej"; + }; + RESOURCE_LEGENDPOSITION( 32 ) + Text[ chinese_simplified ] = "图例"; + Text[ russian ] = ""; + Text[ polish ] = "Legenda"; + Text[ japanese ] = "凡例"; + Text[ chinese_traditional ] = "圖例"; + Text[ arabic ] = " "; + Text[ greek ] = ""; + Text[ korean ] = "범례"; + Text[ turkish ] = "Aklama"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Llegenda"; + Text[ thai ] = "คำอธิบาย"; + Text[ czech ] = "Legenda"; + Text[ hebrew ] = "Legende"; + Text[ hindi ] = "लेजेन्ड़"; + Text[ slovak ] = "Legenda"; +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/source/controller/dialogs/dlg_InsertTitle.cxx b/chart2/source/controller/dialogs/dlg_InsertTitle.cxx new file mode 100644 index 000000000000..373ee82576b2 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertTitle.cxx @@ -0,0 +1,188 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertTitle.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "dlg_InsertTitle.hxx" +#include "dlg_InsertTitle.hrc" + +#include "ResId.hxx" +#include "SchSfxItemIds.hxx" + +// header for class SfxBoolItem +#ifndef _SFXENUMITEM_HXX +#include <svtools/eitem.hxx> +#endif +// header for class SfxStringItem +#ifndef _SFXSTRITEM_HXX +#include <svtools/stritem.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +InsertTitleDialogData::InsertTitleDialogData() + : aPossibilityList(5) + , aExistenceList(5) + , aTextList(5) +{ + for(sal_Int32 nN=5;nN--;) + aPossibilityList[nN]=true; + for(nN=5;nN--;) + aExistenceList[nN]=false; +} + + +SchTitleDlg::SchTitleDlg(Window* pWindow, const InsertTitleDialogData& rInput ) : + ModalDialog(pWindow, SchResId(DLG_TITLE)), + aCbxMain(this, ResId(CBX_MAINTITLE)), + aEdtMain(this, ResId(EDT_MAINTITLE)), + aCbxSub(this, ResId(CBX_SUBTITLE)), + aEdtSub(this, ResId(EDT_SUBTITLE)), + aCbxXAxis(this, ResId(CBX_TITLE_X_AXIS)), + aEdtXAxis(this, ResId(EDT_X_AXIS)), + aCbxYAxis(this, ResId(CBX_TITLE_Y_AXIS)), + aEdtYAxis(this, ResId(EDT_Y_AXIS)), + aCbxZAxis(this, ResId(CBX_TITLE_Z_AXIS)), + aEdtZAxis(this, ResId(EDT_Z_AXIS)), + aBtnOK(this, ResId(BTN_OK)), + aBtnCancel(this, ResId(BTN_CANCEL)), + aBtnHelp(this, ResId(BTN_HELP)) +{ + FreeResource(); + + aCbxMain.SetClickHdl(LINK(this, SchTitleDlg, EnableTitleHdl)); + aCbxSub.SetClickHdl(LINK(this, SchTitleDlg, EnableTitleHdl)); + aCbxXAxis.SetClickHdl(LINK(this, SchTitleDlg, EnableTitleHdl)); + aCbxYAxis.SetClickHdl(LINK(this, SchTitleDlg, EnableTitleHdl)); + aCbxZAxis.SetClickHdl(LINK(this, SchTitleDlg, EnableTitleHdl)); + + aCbxMain.Check( rInput.aExistenceList[0] ); + aCbxSub.Check( rInput.aExistenceList[1] ); + aCbxXAxis.Check( rInput.aExistenceList[2] ); + aCbxYAxis.Check( rInput.aExistenceList[3] ); + aCbxZAxis.Check( rInput.aExistenceList[4] ); + + aCbxMain.Enable( rInput.aPossibilityList[0] ); + aEdtMain.Enable( rInput.aPossibilityList[0] && aCbxMain.IsChecked()); + aCbxSub.Enable( rInput.aPossibilityList[1] ); + aEdtSub.Enable( rInput.aPossibilityList[1] && aCbxSub.IsChecked()); + aCbxXAxis.Enable( rInput.aPossibilityList[2] ); + aEdtXAxis.Enable( rInput.aPossibilityList[2] && aCbxXAxis.IsChecked()); + aCbxYAxis.Enable( rInput.aPossibilityList[3] ); + aEdtYAxis.Enable( rInput.aPossibilityList[3] && aCbxYAxis.IsChecked()); + aCbxZAxis.Enable( rInput.aPossibilityList[4] ); + aEdtZAxis.Enable( rInput.aPossibilityList[4] && aCbxZAxis.IsChecked()); + + aEdtMain.SetText(rInput.aTextList[0]); + aEdtSub.SetText(rInput.aTextList[1]); + aEdtXAxis.SetText(rInput.aTextList[2]); + aEdtYAxis.SetText(rInput.aTextList[3]); + aEdtZAxis.SetText(rInput.aTextList[4]); +} + +SchTitleDlg::~SchTitleDlg() +{ +} + +IMPL_LINK( SchTitleDlg, EnableTitleHdl, CheckBox *, pCbx ) +{ + if (pCbx == &aCbxMain) + { + aEdtMain.Enable(aCbxMain.IsChecked()); + } + else if (pCbx == &aCbxSub) + { + aEdtSub.Enable(aCbxSub.IsChecked()); + } + else if (pCbx == &aCbxXAxis) + { + aEdtXAxis.Enable(aCbxXAxis.IsChecked()); + } + else if (pCbx == &aCbxYAxis) + { + aEdtYAxis.Enable(aCbxYAxis.IsChecked()); + } + else if (pCbx == &aCbxZAxis) + { + aEdtZAxis.Enable(aCbxZAxis.IsChecked()); + } + return 0; +} + +void SchTitleDlg::getResult( InsertTitleDialogData& rOutput ) +{ + rOutput.aExistenceList[0] = aCbxMain.IsChecked() && aEdtMain.GetText().Len(); + rOutput.aExistenceList[1] = aCbxSub.IsChecked() && aEdtSub.GetText().Len(); + rOutput.aExistenceList[2] = aCbxXAxis.IsChecked() && aEdtXAxis.GetText().Len(); + rOutput.aExistenceList[3] = aCbxYAxis.IsChecked() && aEdtYAxis.GetText().Len(); + rOutput.aExistenceList[4] = aCbxZAxis.IsChecked() && aEdtZAxis.GetText().Len(); + + rOutput.aTextList[0] = aEdtMain.GetText(); + rOutput.aTextList[1] = aEdtSub.GetText(); + rOutput.aTextList[2] = aEdtXAxis.GetText(); + rOutput.aTextList[3] = aEdtYAxis.GetText(); + rOutput.aTextList[4] = aEdtZAxis.GetText(); +} + +//............................................................................. +} //namespace chart +//............................................................................. + diff --git a/chart2/source/controller/dialogs/dlg_InsertTitle.hrc b/chart2/source/controller/dialogs/dlg_InsertTitle.hrc new file mode 100644 index 000000000000..984d497084f0 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertTitle.hrc @@ -0,0 +1,74 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertTitle.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#define BTN_OK 1 +#define BTN_CANCEL 1 +#define BTN_HELP 1 +#define EDT_MAINTITLE 1 +#define EDT_SUBTITLE 2 +#define EDT_X_AXIS 3 +#define EDT_Y_AXIS 4 +#define EDT_Z_AXIS 5 +#define CBX_MAINTITLE 1 +#define CBX_SUBTITLE 2 +#define CBX_TITLE_X_AXIS 3 +#define CBX_TITLE_Y_AXIS 4 +#define CBX_TITLE_Z_AXIS 5 +#define DLG_TITLE 834 diff --git a/chart2/source/controller/dialogs/dlg_InsertTitle.src b/chart2/source/controller/dialogs/dlg_InsertTitle.src new file mode 100644 index 000000000000..151dd827b453 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_InsertTitle.src @@ -0,0 +1,342 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertTitle.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include "dlg_InsertTitle.hrc" +#include "SchSlotIds.hxx" +#include "CommonResources.hrc" + +ModalDialog DLG_TITLE +{ + HelpID = SID_INSERT_TITLE ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 240 , 88 ) ; + Text = "Titel" ; + Text [ ENGLISH ] = "Title" ; + Text [ norwegian ] = "Tittel" ; + Text [ italian ] = "Titolo" ; + Text [ portuguese_brazilian ] = "Ttulos" ; + Text [ portuguese ] = "Ttulo" ; + Text [ finnish ] = "Otsikot" ; + Text [ danish ] = "Titel" ; + Text [ french ] = "Titre" ; + Text [ swedish ] = "Rubrik" ; + Text [ dutch ] = "Titel" ; + Text [ spanish ] = "Ttulo" ; + Text [ english_us ] = "Titles" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + BUTTONS_OK_CANCEL_HELP_STACKED(184) + Edit EDT_MAINTITLE + { + Border = TRUE ; + Pos = MAP_APPFONT ( 78 , 6 ) ; + Size = MAP_APPFONT ( 100 , 12 ) ; + TabStop = TRUE ; + }; + Edit EDT_SUBTITLE + { + Border = TRUE ; + Pos = MAP_APPFONT ( 78 , 22 ) ; + Size = MAP_APPFONT ( 100 , 12 ) ; + TabStop = TRUE ; + }; + Edit EDT_X_AXIS + { + Border = TRUE ; + Pos = MAP_APPFONT ( 78 , 38 ) ; + Size = MAP_APPFONT ( 100 , 12 ) ; + TabStop = TRUE ; + }; + Edit EDT_Y_AXIS + { + Border = TRUE ; + Pos = MAP_APPFONT ( 78 , 54 ) ; + Size = MAP_APPFONT ( 100 , 12 ) ; + TabStop = TRUE ; + }; + Edit EDT_Z_AXIS + { + Border = TRUE ; + Pos = MAP_APPFONT ( 78 , 70 ) ; + Size = MAP_APPFONT ( 100 , 12 ) ; + TabStop = TRUE ; + }; + CheckBox CBX_MAINTITLE + { + Pos = MAP_APPFONT ( 6 , 6 ) ; + Size = MAP_APPFONT ( 68 , 12 ) ; + Text = "~Haupttitel" ; + Text [ ENGLISH ] = "~Main Title" ; + Text [ norwegian ] = "~Main Title" ; + Text [ italian ] = "Titolo principale" ; + Text [ portuguese_brazilian ] = "Ttulo ~Principal" ; + Text [ portuguese ] = "Ttulo ~principal" ; + Text [ finnish ] = "~Potsikko" ; + Text [ danish ] = "Overskrift" ; + Text [ french ] = "Titre ~principal" ; + Text [ swedish ] = "Huvud~rubrik" ; + Text [ dutch ] = "~Hoofdtitel" ; + Text [ spanish ] = "~Ttulo principal" ; + Text [ english_us ] = "~Main Title" ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "主标题(~M)"; + Text[ russian ] = " "; + Text[ polish ] = "Tytu ~gwny"; + Text[ japanese ] = "メインタイトル(~M)"; + Text[ chinese_traditional ] = "主標題(~M)"; + Text[ arabic ] = " "; + Text[ greek ] = "~ "; + Text[ korean ] = "주 제목(~M)"; + Text[ turkish ] = "~Ana balk"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Ttol principal"; + Text[ thai ] = "ชื่อ~หลัก"; + Text[ czech ] = "Titul"; + Text[ hebrew ] = "~Haupttitel"; + Text[ hindi ] = "~प्रधान शीर्षक"; + Text[ slovak ] = "~Hlavný nadpis"; + }; + CheckBox CBX_SUBTITLE + { + Pos = MAP_APPFONT ( 6 , 22 ) ; + Size = MAP_APPFONT ( 68 , 12 ) ; + Text = "~Untertitel" ; + Text [ ENGLISH ] = "~Sub Title" ; + Text [ norwegian ] = "~Sub Title" ; + Text [ italian ] = "Sottotitolo" ; + Text [ portuguese_brazilian ] = "~Sub-ttulo" ; + Text [ portuguese ] = "~Subttulo" ; + Text [ finnish ] = "~Alaotsikko" ; + Text [ danish ] = "Undertitel" ; + Text [ french ] = "~Sous-titre" ; + Text [ swedish ] = "~Underrubrik" ; + Text [ dutch ] = "~Subtitel" ; + Text [ spanish ] = "~Subttulo" ; + Text [ english_us ] = "~Subtitle" ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "分标题(~S)"; + Text[ russian ] = ""; + Text[ polish ] = "~Podtytu"; + Text[ japanese ] = "サブタイトル(~S)"; + Text[ chinese_traditional ] = "分標題(~S)"; + Text[ arabic ] = " "; + Text[ greek ] = ""; + Text[ korean ] = "부제(~S)"; + Text[ turkish ] = "~Alt balk"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Subttol"; + Text[ thai ] = "ชื่อ~รอง"; + Text[ czech ] = "Podtitul"; + Text[ hebrew ] = "~Untertitel"; + Text[ hindi ] = "~उपशीर्षक"; + Text[ slovak ] = "P~odnadpis"; + }; + CheckBox CBX_TITLE_X_AXIS + { + Pos = MAP_APPFONT ( 6 , 38 ) ; + Size = MAP_APPFONT ( 68 , 12 ) ; + Text = "~X-Achse" ; + Text [ ENGLISH ] = "~X-Axis" ; + Text [ norwegian ] = "~X-Axis" ; + Text [ italian ] = "Asse ~X" ; + Text [ portuguese_brazilian ] = "Eixo ~X" ; + Text [ portuguese ] = "~Eixo X" ; + Text [ finnish ] = "~X-akseli" ; + Text [ danish ] = "X-akse" ; + Text [ french ] = "Axe X" ; + Text [ swedish ] = "~X-axel" ; + Text [ dutch ] = "~X-as" ; + Text [ spanish ] = "Eje ~X" ; + Text [ english_us ] = "~X axis" ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "~X 轴"; + Text[ russian ] = " X"; + Text[ polish ] = "O ~X"; + Text[ japanese ] = "~X 軸"; + Text[ chinese_traditional ] = "~X 軸"; + Text[ arabic ] = " "; + Text[ greek ] = " X"; + Text[ korean ] = "~X 축"; + Text[ turkish ] = "~X ekseni"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Eix ~X"; + Text[ thai ] = "แกน~X "; + Text[ czech ] = "Osa X"; + Text[ hebrew ] = "~X-Achse"; + Text[ hindi ] = "~X अक्ष"; + Text[ slovak ] = "Os ~X"; + }; + CheckBox CBX_TITLE_Y_AXIS + { + Pos = MAP_APPFONT ( 6 , 54 ) ; + Size = MAP_APPFONT ( 68 , 12 ) ; + Text = "~Y-Achse" ; + Text [ ENGLISH ] = "~Y-Axis" ; + Text [ norwegian ] = "~Y-Axis" ; + Text [ italian ] = "Asse ~Y" ; + Text [ portuguese_brazilian ] = "Eixo ~Y" ; + Text [ portuguese ] = "~Eixo Y" ; + Text [ finnish ] = "~Y-akseli" ; + Text [ danish ] = "Y-akse" ; + Text [ french ] = "Axe ~Y" ; + Text [ swedish ] = "~Y-axel" ; + Text [ dutch ] = "~Y-as" ; + Text [ spanish ] = "Eje ~Y" ; + Text [ english_us ] = "~Y axis" ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "~Y 轴"; + Text[ russian ] = " Y"; + Text[ polish ] = "O ~Y"; + Text[ japanese ] = "~Y 軸"; + Text[ chinese_traditional ] = "~Y 軸"; + Text[ arabic ] = " "; + Text[ greek ] = " ~"; + Text[ korean ] = "~Y 축"; + Text[ turkish ] = "~Y ekseni"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Eix ~Y"; + Text[ thai ] = "แกน~Y "; + Text[ czech ] = "Osa Y"; + Text[ hebrew ] = "~Y-Achse"; + Text[ hindi ] = "~Y अक्ष"; + Text[ slovak ] = "Os ~Y"; + }; + CheckBox CBX_TITLE_Z_AXIS + { + Pos = MAP_APPFONT ( 6 , 70 ) ; + Size = MAP_APPFONT ( 68 , 12 ) ; + Text = "~Z-Achse" ; + Text [ ENGLISH ] = "~Z-Axis" ; + Text [ norwegian ] = "~Z-Axis" ; + Text [ italian ] = "Asse ~Z" ; + Text [ portuguese_brazilian ] = "Eixo ~Z" ; + Text [ portuguese ] = "Eixo ~Z" ; + Text [ finnish ] = "~Z-akseli" ; + Text [ danish ] = "Z-akse" ; + Text [ french ] = "Axe ~Z" ; + Text [ swedish ] = "~Z-axel" ; + Text [ dutch ] = "~Z-as" ; + Text [ spanish ] = "Eje ~Z" ; + Text [ english_us ] = "~Z axis" ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "~Z 轴"; + Text[ russian ] = " Z"; + Text[ polish ] = "O ~Z"; + Text[ japanese ] = "~Z 軸"; + Text[ chinese_traditional ] = "~Z 軸"; + Text[ arabic ] = " "; + Text[ greek ] = " Z"; + Text[ korean ] = "~Z 축"; + Text[ turkish ] = "~Z ekseni"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Eix ~Z"; + Text[ thai ] = "แกน~Z "; + Text[ czech ] = "Osa Z"; + Text[ hebrew ] = "~Z-Achse"; + Text[ hindi ] = "~Z अक्ष"; + Text[ slovak ] = "Os ~Z"; + }; + Text[ chinese_simplified ] = "标题"; + Text[ russian ] = ""; + Text[ polish ] = "Tytu"; + Text[ japanese ] = "タイトル"; + Text[ chinese_traditional ] = "標題"; + Text[ arabic ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "제목"; + Text[ turkish ] = "Balk"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Ttol"; + Text[ thai ] = "ชื่อ"; + Text[ czech ] = "Tituly"; + Text[ hebrew ] = "Titel"; + Text[ hindi ] = "शीर्षक"; + Text[ slovak ] = "Nadpisy"; +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx new file mode 100644 index 000000000000..594482477f87 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx @@ -0,0 +1,605 @@ +/************************************************************************* + * + * $RCSfile: dlg_ObjectProperties.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _ZFORLIST_HXX +#ifndef _ZFORLIST_DECLARE_TABLE +#define _ZFORLIST_DECLARE_TABLE +#endif +#include <svtools/zforlist.hxx> +#endif + +#include "dlg_ObjectProperties.hxx" +#include "dlg_ObjectProperties.hrc" +#include "TabPages.hrc" +#include "tp_AxisLabel.hxx" +#include "tp_DataLabel.hxx" +#include "tp_LegendPosition.hxx" +#include "tp_PointGeometry.hxx" +#include "tp_Scale.hxx" +#include "tp_SeriesStatistic.hxx" +#include "tp_SeriesToAxis.hxx" +#include "tp_TitleRotation.hxx" +#include "SchSlotIds.hxx" +#include "ResId.hxx" +#include "ViewElementListProvider.hxx" + +#ifndef _SVX_CHARDLG_HXX +#include <svx/chardlg.hxx> +#endif +#ifndef _SVX_DIALOGS_HRC +#include <svx/dialogs.hrc> +#endif +#ifndef _SVX_FLSTITEM_HXX +#include <svx/flstitem.hxx> +#endif +#ifndef _SVX_TAB_LINE_HXX +#include <svx/tabline.hxx> +#endif + + +#ifndef _SVX_NUMFMT_HXX +#include <svx/numfmt.hxx> +#endif + +#define ITEMID_NUMBERINFO SID_ATTR_NUMBERFORMAT_INFO +#ifndef _SVX_NUMINF_HXX +#include <svx/numinf.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +/************************************************************************/ + +//provide Resource-Id of a tab dialog for the given ObjectType +USHORT SchAttribTabDlg::GetResId(ObjectType eObjectType) +{ + USHORT nRet=0; + switch( eObjectType ) + { + case OBJECTTYPE_PAGE: + nRet=TAB_DIAGRAM_AREA; + break; + case OBJECTTYPE_TITLE: + nRet=TAB_TITLE; + break; + case OBJECTTYPE_LEGEND: + nRet=TAB_LEGEND; + break; + case OBJECTTYPE_LEGEND_ENTRY: + nRet=0;//@todo there is not tab dialog so far + break; + case OBJECTTYPE_DIAGRAM: + nRet=TAB_DIAGRAM_WALL;//@todo ... maybe size,pos,rotation depth ...? + break; + case OBJECTTYPE_DIAGRAM_WALL: + nRet=TAB_DIAGRAM_WALL; + break; + case OBJECTTYPE_DIAGRAM_FLOOR: + nRet=TAB_DIAGRAM_FLOOR; + break; + case OBJECTTYPE_AXIS: + nRet=TAB_AXIS;//@todo need further specialisation for titles (x,y,z axis) + //and for z axis hide pages PAGE_AXISSCALE and PAGE_NUMBERFORMAT + break; + case OBJECTTYPE_AXIS_UNITLABEL: + nRet=0;//@todo there is not tab dialog so far + break; + case OBJECTTYPE_GRID: + nRet=TAB_GRID; + break; + case OBJECTTYPE_DATA_LABELS: + case OBJECTTYPE_DATA_SERIES: + nRet=TAB_DATA_ROW; + //@todo ( old case ATTR_DATA_LINE - TAB_DATA_LINE ) + //for line oriented series hide folloing pages: PAGE_AREA PAGE_TRANSPARENCE and PAGE_LAYOUT + break; + case OBJECTTYPE_DATA_LABEL: + case OBJECTTYPE_DATA_POINT: + nRet=TAB_DATA_POINT; + break; + case OBJECTTYPE_DATA_ERRORS: + nRet=TAB_LINE; + break; + case OBJECTTYPE_DATA_ERRORS_X: + nRet=TAB_LINE; + break; + case OBJECTTYPE_DATA_ERRORS_Y: + nRet=TAB_LINE; + break; + case OBJECTTYPE_DATA_ERRORS_Z: + nRet=TAB_LINE; + break; + case OBJECTTYPE_DATA_FUNCTION: + nRet=TAB_LINE; + break; + case OBJECTTYPE_DATA_STOCK_RANGE: + nRet=TAB_LINE; + break; + case OBJECTTYPE_DATA_STOCK_LOSS: + nRet=TAB_DIAGRAM_STOCK_LOSS; + break; + case OBJECTTYPE_DATA_STOCK_GAIN: + nRet=TAB_DIAGRAM_STOCK_PLUS; + break; + default: //OBJECTTYPE_UNKNOWN + nRet=0; + } + if(nRet==0) + { + DBG_ERROR("Do not have an associated tab dialog for this ObjectType"); + nRet=TAB_LINE; + } + return nRet; +} +/* +USHORT SchAttribTabDlg::GetResId(AttrType eType) +{ + switch (eType) + { + case ATTR_TITLE: return TAB_TITLE; + case ATTR_LEGEND: return TAB_LEGEND; + case ATTR_DATA_ROW: return TAB_DATA_ROW; + case ATTR_DATA_LINE: return TAB_DATA_LINE; + case ATTR_DATA_POINT: return TAB_DATA_POINT; + case ATTR_AXIS: return TAB_AXIS; + case ATTR_X_AXIS_2D: + case ATTR_X_AXIS_3D: return TAB_X_AXIS; + case ATTR_Y_AXIS_2D: + case ATTR_Y_AXIS_3D: return TAB_Y_AXIS; + case ATTR_Z_AXIS: return TAB_Z_AXIS; + case ATTR_GRID: return TAB_GRID; + case ATTR_LINE: return TAB_LINE; + case ATTR_DIAGRAM_AREA: return TAB_DIAGRAM_AREA; + case ATTR_DIAGRAM_WALL: return TAB_DIAGRAM_WALL; + case ATTR_DIAGRAM_FLOOR: return TAB_DIAGRAM_FLOOR; + case ATTR_DIAGRAM_STOCK_LOSS: return TAB_DIAGRAM_STOCK_LOSS; + case ATTR_DIAGRAM_STOCK_PLUS: return TAB_DIAGRAM_STOCK_PLUS; + default: return 0; + } +} +*/ +//------------------------------------------------------------------- + +OldModelWrapper::OldModelWrapper() +{ +} + +OldModelWrapper::~OldModelWrapper() +{ +} +/* +BOOL OldModelWrapper::IsXYChart() const +{ + return false; +} +*/ +BOOL OldModelWrapper::IsBar() const +{ + return true; +} +BOOL OldModelWrapper::Is3DChart() const +{ + return false; +} +/* +BOOL OldModelWrapper::Is3DPie() const +{ + return false; +} +*/ +BOOL OldModelWrapper::IsStatisticChart() const +{ + return true; +} + +BOOL OldModelWrapper::HasAreaProperties() const +{ + return true; +} +BOOL OldModelWrapper::HasScaleProperties() const +{ + return true; +} + +BOOL OldModelWrapper::ProvidesSecondaryYAxis() const +{ + return true; +} +BOOL OldModelWrapper::IsCol( long nRow ) const +{ + return false; +} + +/************************************************************************* +|* +|* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu +|* +\************************************************************************/ + +//const USHORT nNoArrowDlg = 1100; +const USHORT nNoArrowNoShadowDlg = 1101; + +SchAttribTabDlg::SchAttribTabDlg(Window* pParent, ObjectType eType, + const SfxItemSet* pAttr, + const ViewElementListProvider* pViewElementListProvider, + const OldModelWrapper* pModel, + bool AffectsMultipleObjects, + const SfxItemSet* pSymbolAttr, + Graphic aGraphic) + : SfxTabDialog(pParent, SchResId(GetResId(eType)), pAttr) + , eObjectType(eType) + , bAffectsMultipleObjects(AffectsMultipleObjects) + , nDlgType(nNoArrowNoShadowDlg) + , nPageType(0) + , m_pModelWrapper( pModel ) + , m_pViewElementListProvider( pViewElementListProvider ) + , mpSymbolAttr(pSymbolAttr) + , maSymbolGraphic(aGraphic) +/* + , pColorTab(pViewElementListProvider->GetColorTable()) + , pGradientList(pViewElementListProvider->GetGradientList()) + , pHatchingList(pViewElementListProvider->GetHatchList()) + , pBitmapList(pViewElementListProvider->GetBitmapList()) + , pDashList(pViewElementListProvider->GetDashList()) + , pLineEndList(pViewElementListProvider->GetLineEndList()) +*/ + , nColorTableState(CT_NONE) + , nGradientListState(CT_NONE) + , nHatchingListState(CT_NONE) + , nBitmapListState(CT_NONE) +{ + FreeResource(); + switch (eObjectType) + { + case OBJECTTYPE_TITLE://ATTR_TITLE: + AddTabPage(RID_SVXPAGE_LINE, SvxLineTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_AREA, SvxAreaTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_TRANSPARENCE, SvxTransparenceTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, NULL); + AddTabPage(TP_ALIGNMENT, SchAlignmentTabPage::Create, NULL); + /*if (//(nID == CHOBJID_DIAGRAM_TITLE_X_AXIS) || (nID == CHOBJID_DIAGRAM_TITLE_Z_AXIS) || + (nID == CHOBJID_TITLE_MAIN) || (nID == CHOBJID_TITLE_SUB)) + RemoveTabPage (TP_ALIGNMENT);*/ +//// nDlgType = nNoArrowDlg; + break; + + case OBJECTTYPE_LEGEND://ATTR_LEGEND: + AddTabPage(RID_SVXPAGE_LINE, SvxLineTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_AREA, SvxAreaTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_TRANSPARENCE, SvxTransparenceTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, NULL); + AddTabPage(TP_LEGEND_POS, SchLegendPosTabPage::Create, NULL); +//// nDlgType = nNoArrowDlg; + break; + + case OBJECTTYPE_DATA_SERIES://ATTR_DATA_ROW: + case OBJECTTYPE_DATA_POINT://ATTR_DATA_POINT: + case OBJECTTYPE_DATA_LABEL: + case OBJECTTYPE_DATA_LABELS: + AddTabPage(RID_SVXPAGE_LINE, SvxLineTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_AREA, SvxAreaTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_TRANSPARENCE, SvxTransparenceTabPage::Create, NULL); + if(!m_pModelWrapper->HasAreaProperties()) + { + RemoveTabPage(RID_SVXPAGE_AREA); + RemoveTabPage(RID_SVXPAGE_TRANSPARENCE); + } + AddTabPage(RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, NULL); + AddTabPage(TP_DATA_DESCR, SchDataDescrTabPage::Create, NULL); + AddTabPage(TP_STAT, SchStatisticTabPage::Create, NULL); + if( OBJECTTYPE_DATA_POINT == eObjectType + || OBJECTTYPE_DATA_LABEL == eObjectType + || !m_pModelWrapper->IsStatisticChart()) + { + RemoveTabPage (TP_STAT); + } + AddTabPage(TP_LAYOUT,SchLayoutTabPage::Create, NULL); + // Layout tab only for 3D bar and column charts. + if( !(m_pModelWrapper->Is3DChart() && (m_pModelWrapper->IsBar() || m_pModelWrapper->IsCol(0)))) + RemoveTabPage(TP_LAYOUT); + /* + if(m_pModelWrapper->Is3DPie() ) + RemoveTabPage(TP_LAYOUT); + */ + + AddTabPage(TP_OPTIONS,SchOptionTabPage::Create, NULL); + //if ((((const SfxInt32Item &)pAttr->Get (SCHATTR_DUMMY1)).GetValue () == CHOBJID_DIAGRAM_DATA) || + + if( OBJECTTYPE_DATA_POINT == eObjectType + || OBJECTTYPE_DATA_LABEL == eObjectType + || !m_pModelWrapper->ProvidesSecondaryYAxis() ) + RemoveTabPage(TP_OPTIONS); + +//// nDlgType = nNoArrowNoShadowDlg; + break; + + /* + case OBJECTTYPE_DATA_SERIES://ATTR_DATA_LINE: + + AddTabPage(RID_SVXPAGE_LINE, SvxLineTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, NULL); + AddTabPage(TP_DATA_DESCR, SchDataDescrTabPage::Create, NULL); + //if (m_pModelWrapper->IsStatisticChart()) + AddTabPage(TP_STAT, SchStatisticTabPage::Create, NULL); + AddTabPage(TP_OPTIONS,SchOptionTabPage::Create, NULL); + if (!m_pModelWrapper->IsStatisticChart()) + RemoveTabPage (TP_STAT); + if(!m_pModelWrapper->ProvidesSecondaryYAxis()) + RemoveTabPage(TP_OPTIONS); + nDlgType = nNoArrowDlg; + break; + */ + + + /* + case OBJECTTYPE_AXIS://ATTR_AXIS: + AddTabPage(RID_SVXPAGE_LINE, SvxLineTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, NULL); + AddTabPage(TP_AXIS_LABEL, SchAxisLabelTabPage::Create, NULL); + nDlgType = nNoArrowDlg; + break; + + case ATTR_X_AXIS_2D: + */ + case OBJECTTYPE_AXIS: + { + AddTabPage(RID_SVXPAGE_LINE, SvxLineTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, NULL); + AddTabPage(TP_AXIS_LABEL, SchAxisLabelTabPage::Create, NULL); + AddTabPage(TP_SCALE_Y, SchScaleYAxisTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_NUMBERFORMAT, SvxNumberFormatTabPage::Create, NULL); + + if( bAffectsMultipleObjects || !m_pModelWrapper->HasScaleProperties() ) + { + RemoveTabPage (TP_SCALE_Y); + RemoveTabPage (RID_SVXPAGE_NUMBERFORMAT); + } +//// nDlgType = nNoArrowDlg; +//// ((SfxItemSet * const) pAttr)->ClearItem (SCHATTR_AXISTYPE); +//// ((SfxItemSet *) pAttr)->Put (SfxInt32Item (SCHATTR_AXISTYPE, CHART_AXIS_X)); + +//// nAxisType = 1; + break; + } + + /* + case ATTR_Y_AXIS_2D: + case ATTR_Y_AXIS_3D: + AddTabPage(RID_SVXPAGE_LINE, SvxLineTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, NULL); + AddTabPage(TP_SCALE_Y, SchScaleYAxisTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_NUMBERFORMAT, SvxNumberFormatTabPage::Create, NULL); + AddTabPage(TP_AXIS_LABEL, SchAxisLabelTabPage::Create, NULL); + nDlgType = nNoArrowDlg; +//// ((SfxItemSet * const) pAttr)->ClearItem (SCHATTR_AXISTYPE); +//// ((SfxItemSet *) pAttr)->Put (SfxInt32Item (SCHATTR_AXISTYPE, CHART_AXIS_Y)); + +//// nAxisType = 2; + break; + + case ATTR_Z_AXIS: + AddTabPage(RID_SVXPAGE_LINE, SvxLineTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_NAME, SvxCharNamePage::Create, NULL); + AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, SvxCharEffectsPage::Create, NULL); + AddTabPage(TP_AXIS_LABEL, SchAxisLabelTabPage::Create, NULL); + nDlgType = nNoArrowDlg; +//// ((SfxItemSet * const) pAttr)->ClearItem (SCHATTR_AXISTYPE); +//// ((SfxItemSet *) pAttr)->Put (SfxInt32Item (SCHATTR_AXISTYPE, CHART_AXIS_Z)); + +//// nAxisType = 3; + break; + */ + case OBJECTTYPE_GRID: //ATTR_GRID + case OBJECTTYPE_DATA_ERRORS: + case OBJECTTYPE_DATA_ERRORS_X: + case OBJECTTYPE_DATA_ERRORS_Y: + case OBJECTTYPE_DATA_ERRORS_Z: + case OBJECTTYPE_DATA_FUNCTION: + case OBJECTTYPE_DATA_STOCK_RANGE://ATTR_LINE + AddTabPage(RID_SVXPAGE_LINE, SvxLineTabPage::Create, NULL); +//// nDlgType = nNoArrowDlg; + break; + + case OBJECTTYPE_DATA_STOCK_LOSS://ATTR_DIAGRAM_STOCK_LOSS: + case OBJECTTYPE_DATA_STOCK_GAIN://ATTR_DIAGRAM_STOCK_PLUS: + case OBJECTTYPE_PAGE://ATTR_DIAGRAM_AREA: + case OBJECTTYPE_DIAGRAM_FLOOR://ATTR_DIAGRAM_FLOOR: + case OBJECTTYPE_DIAGRAM_WALL://ATTR_DIAGRAM_WALL: + case OBJECTTYPE_DIAGRAM://ATTR_DIAGRAM_WALL: //@todo + AddTabPage(RID_SVXPAGE_LINE, SvxLineTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_AREA, SvxAreaTabPage::Create, NULL); + AddTabPage(RID_SVXPAGE_TRANSPARENCE, SvxTransparenceTabPage::Create, NULL); +//// nDlgType = nNoArrowNoShadowDlg; + break; + } +} + +/************************************************************************* +|* +|* Destruktor +|* +\************************************************************************/ + +SchAttribTabDlg::~SchAttribTabDlg() +{ +} + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +void SchAttribTabDlg::PageCreated(USHORT nId, SfxTabPage &rPage) +{ + switch (nId) + { + case TP_LAYOUT: + break; + case RID_SVXPAGE_LINE: + ((SvxLineTabPage&)rPage).SetColorTable(m_pViewElementListProvider->GetColorTable()); + ((SvxLineTabPage&)rPage).SetDashList(m_pViewElementListProvider->GetDashList()); + ((SvxLineTabPage&)rPage).SetLineEndList(m_pViewElementListProvider->GetLineEndList()); + ((SvxLineTabPage&)rPage).SetPageType(&nPageType); + ((SvxLineTabPage&)rPage).SetDlgType(&nDlgType); + ((SvxLineTabPage&)rPage).Construct(); + ((SvxLineTabPage&)rPage).ActivatePage(*GetInputSetImpl()); + if(mpSymbolAttr)//unfein, aber wenn man schon die Attribute setzt, wird es wohl ne Linie + { //mit Symbolen sein. + ((SvxLineTabPage&)rPage).ShowSymbolControls(TRUE); + ((SvxLineTabPage&)rPage).SetSymbolList(m_pViewElementListProvider->GetSymbolList()); + ((SvxLineTabPage&)rPage).SetSymbolAttr(mpSymbolAttr); + ((SvxLineTabPage&)rPage).SetAutoSymbolGraphic(&maSymbolGraphic); + } + break; + + case RID_SVXPAGE_AREA: + ((SvxAreaTabPage&)rPage).SetColorTable(m_pViewElementListProvider->GetColorTable()); + ((SvxAreaTabPage&)rPage).SetGradientList(m_pViewElementListProvider->GetGradientList()); + ((SvxAreaTabPage&)rPage).SetHatchingList(m_pViewElementListProvider->GetHatchList()); + ((SvxAreaTabPage&)rPage).SetBitmapList(m_pViewElementListProvider->GetBitmapList()); + ((SvxAreaTabPage&)rPage).SetPageType(&nPageType); + ((SvxAreaTabPage&)rPage).SetDlgType(&nDlgType); + ((SvxAreaTabPage&)rPage).SetGrdChgd(&nGradientListState); + ((SvxAreaTabPage&)rPage).SetHtchChgd(&nHatchingListState); + ((SvxAreaTabPage&)rPage).SetBmpChgd(&nBitmapListState); + ((SvxAreaTabPage&)rPage).SetColorChgd(&nColorTableState); + ((SvxAreaTabPage&)rPage).Construct(); + ((SvxAreaTabPage&)rPage).ActivatePage(*GetInputSetImpl()); + break; + + case RID_SVXPAGE_TRANSPARENCE: + ( (SvxTransparenceTabPage&) rPage ).SetPageType( &nPageType ); + ( (SvxTransparenceTabPage&) rPage ).SetDlgType( &nDlgType ); + ( (SvxTransparenceTabPage&) rPage ).Construct(); + break; + + case RID_SVXPAGE_CHAR_NAME: + ((SvxCharNamePage&)rPage). + SetFontList(SvxFontListItem(m_pViewElementListProvider->getFontList())); + break; + + case RID_SVXPAGE_CHAR_EFFECTS: + ((SvxCharEffectsPage&) rPage).DisableControls( DISABLE_CASEMAP ); + break; + + case TP_AXIS_LABEL: + { + //for 3D axis staggering is disabled + BOOL bShowStaggeringControls = !m_pModelWrapper->Is3DChart(); + ((SchAxisLabelTabPage&)rPage).ShowStaggeringControls( bShowStaggeringControls ); +//// ((SchAxisLabelTabPage&)rPage).AllowTextOverlap( TRUE ); + break; + } + + case TP_ALIGNMENT: + { + /* + OrderMode eMode; + switch (eObjectType) + { + case ATTR_X_AXIS_2D: + eMode = CHORDMODE_X_AXIS; + break; + + case ATTR_Y_AXIS_2D: + eMode = CHORDMODE_Y_AXIS; + break; + + default: + eMode = CHORDMODE_NONE; + break; + } + ((SchAlignmentTabPage&)rPage).SetOrderMode(eMode); + xxx + */ + ((SchAlignmentTabPage&)rPage).SetTextCanOverlap(/*m_pModelWrapper->IsReal3D()*/TRUE); + break; + } + + case TP_SCALE_Y: + { + SchScaleYAxisTabPage & rAxisTabPage = static_cast< SchScaleYAxisTabPage & >( rPage ); + + // #101318# use own number formatter with higher precision for + // rendering the values in the dialog. + rAxisTabPage.SetNumFormatter( m_pViewElementListProvider->GetOwnNumberFormatter() ); + } + break; + + case RID_SVXPAGE_NUMBERFORMAT: + ((SvxNumberFormatTabPage&)rPage).SetNumberFormatList(SvxNumberInfoItem(m_pViewElementListProvider->GetNumFormatter())); + break; + } +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.src b/chart2/source/controller/dialogs/dlg_ObjectProperties.src new file mode 100644 index 000000000000..30378bc5f840 --- /dev/null +++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.src @@ -0,0 +1,1602 @@ +/************************************************************************* + * + * $RCSfile: dlg_ObjectProperties.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "dlg_ObjectProperties.hrc" +#include "TabPages.hrc" + +#ifndef _SVX_DIALOGS_HRC +#include <svx/dialogs.hrc> +#endif + +#define PAGE_LINE \ +PageItem \ +{ \ + Identifier = RID_SVXPAGE_LINE ; \ + PageResID = RID_SVXPAGE_LINE ; \ + Text = "Linie" ; \ +}; +/* + Text [ ENGLISH ] = "Line" ; + Text [ english_us ] = "Borders" ; + Text [ italian ] = "Linea" ; + Text [ spanish ] = "Bordes" ; + Text [ french ] = "Bordure" ; + Text [ dutch ] = "Lijn" ; + Text [ swedish ] = "Linje" ; + Text [ danish ] = "Ramme" ; + Text [ portuguese ] = "Contornos" ; + Text [ portuguese_brazilian ] = "Bordas" ; + Text[ chinese_simplified ] = "线条"; + Text[ russian ] = ""; + Text[ polish ] = "Krawdzie"; + Text[ japanese ] = "外枠線"; + Text[ chinese_traditional ] = "線條"; + Text[ arabic ] = ""; + Text[ dutch ] = "Lijn"; + Text[ chinese_simplified ] = "线条"; + Text[ greek ] = ""; + Text[ korean ] = "테두리"; + Text[ turkish ] = "izgi"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Vores"; + Text[ finnish ] = "Reunat"; + Text[ thai ] = "เส้นขอบ"; + Text[ czech ] = "Okraje"; + Text[ hebrew ] = "מסגרות"; + Text[ hindi ] = "किनारें"; + Text[ slovak ] = "Okraje"; +*/ + + +#define PAGE_AREA \ +PageItem \ +{ \ + Identifier = RID_SVXPAGE_AREA ; \ + PageResID = RID_SVXPAGE_AREA ; \ + Text = "Flche" ; \ +}; +/* + Text [ ENGLISH ] = "Area" ; + Text [ english_us ] = "Area" ; + Text [ norwegian ] = "Omrde" ; + Text [ italian ] = "Area" ; + Text [ portuguese_brazilian ] = "rea" ; + Text [ portuguese ] = "Preenchimento" ; + Text [ finnish ] = "Alue" ; + Text [ danish ] = "Omrde" ; + Text [ french ] = "Remplissage" ; + Text [ swedish ] = "Yta" ; + Text [ dutch ] = "Vlak" ; + Text [ spanish ] = "rea" ; + Text[ chinese_simplified ] = "平面"; + Text[ russian ] = ""; + Text[ polish ] = "Obszar"; + Text[ japanese ] = "エリア"; + Text[ chinese_traditional ] = "平面"; + Text[ arabic ] = ""; + Text[ dutch ] = "Vlak"; + Text[ chinese_simplified ] = "平面"; + Text[ greek ] = ""; + Text[ korean ] = "영역"; + Text[ turkish ] = "Yzey"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "rea"; + Text[ thai ] = "พื้นที่"; + Text[ czech ] = "Oblast"; + Text[ hebrew ] = "Fläche"; + Text[ hindi ] = "विस्तीर्ण"; + Text[ slovak ] = "Oblasť"; +*/ + +#define PAGE_TRANSPARENCE \ +PageItem \ +{ \ + Identifier = RID_SVXPAGE_TRANSPARENCE ; \ + PageResID = RID_SVXPAGE_TRANSPARENCE ; \ + Text = "Transparenz" ; \ +}; +/* + Text [ ENGLISH ] = "Transparence"; + Text[ english_us ] = "Transparency"; + Text[ portuguese ] = "Transparncia"; + Text[ russian ] = ""; + Text[ greek ] = ""; + Text[ dutch ] = "Transparantie"; + Text[ french ] = "Transparence"; + Text[ spanish ] = "Transparencia"; + Text[ italian ] = "Trasparenza"; + Text[ danish ] = "Transparens"; + Text[ swedish ] = "Transparens"; + Text[ polish ] = "Przezroczysto"; + Text[ portuguese_brazilian ] = "Transparncia"; + Text[ japanese ] = "透過性"; + Text[ korean ] = "투명도"; + Text[ chinese_simplified ] = "透明"; + Text[ chinese_traditional ] = "透明"; + Text[ arabic ] = ""; + Text[ turkish ] = "Saydamlk"; + Text[ catalan ] = "Transparncia"; + Text[ finnish ] = "Lpinkyvyys"; + Text[ thai ] = "โปร่งแสง"; + Text[ czech ] = "Průhlednost"; + Text[ hebrew ] = "Transparenz"; + Text[ hindi ] = "पारदर्शकता"; + Text[ slovak ] = "Priehľadnosť"; +*/ + +#define PAGE_CHARACTERS \ +PageItem \ +{ \ + Identifier = RID_SVXPAGE_CHAR_NAME ; \ + PageResID = RID_SVXPAGE_CHAR_NAME ; \ + Text = "Zeichen" ; \ +}; +/* + Text [ ENGLISH ] = "Char" ; + Text [ english_us ] = "Characters" ; + Text [ norwegian ] = "Char" ; + Text [ italian ] = "Carattere" ; + Text [ portuguese_brazilian ] = "Caracteres" ; + Text [ portuguese ] = "Caracteres" ; + Text [ finnish ] = "Merkit" ; + Text [ danish ] = "Tegn" ; + Text [ french ] = "Caractres" ; + Text [ swedish ] = "Tecken" ; + Text [ dutch ] = "Tekens" ; + Text [ spanish ] = "Caracteres" ; + Text[ chinese_simplified ] = "字符"; + Text[ russian ] = ""; + Text[ polish ] = "Znaki"; + Text[ japanese ] = "文字"; + Text[ chinese_traditional ] = "字元"; + Text[ arabic ] = ""; + Text[ dutch ] = "Tekens"; + Text[ chinese_simplified ] = "字符"; + Text[ greek ] = ""; + Text[ korean ] = "글꼴"; + Text[ turkish ] = "Karakterler"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Carcters"; + Text[ thai ] = "ตัวอักขระ"; + Text[ czech ] = "Znaky"; + Text[ hebrew ] = "תוים"; + Text[ hindi ] = "अक्षरें"; + Text[ slovak ] = "Znaky"; +*/ + +#define PAGE_FONTEFFECTS \ +PageItem \ +{ \ + Identifier = RID_SVXPAGE_CHAR_EFFECTS ; \ + PageResID = RID_SVXPAGE_CHAR_EFFECTS ; \ + Text = "Schrifteffekt" ; \ +}; +/* + Text [ ENGLISH ] = "Character Extension" ; + Text [ english_us ] = "Font Effects" ; + Text [ norwegian ] = "Character Extension" ; + Text [ italian ] = "Effetto carattere" ; + Text [ portuguese_brazilian ] = "Efeitos da Fonte" ; + Text [ portuguese ] = "Efeitos do tipo de letra" ; + Text [ finnish ] = "Fonttitehosteet" ; + Text [ danish ] = "Skrifteffekt" ; + Text [ french ] = "Effets de caractres" ; + Text [ swedish ] = "Teckeneffekt" ; + Text [ dutch ] = "Schrifteffect" ; + Text [ spanish ] = "Efectos de fuente" ; + Text[ chinese_simplified ] = "字体效果"; + Text[ russian ] = " "; + Text[ polish ] = "Efekty czcionki"; + Text[ japanese ] = "フォント効果"; + Text[ chinese_traditional ] = "字型效果"; + Text[ arabic ] = " "; + Text[ greek ] = " "; + Text[ korean ] = "글꼴 효과"; + Text[ turkish ] = "Yaz Tipi Efektleri"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Efectes de lletra"; + Text[ thai ] = "ลักษณะตัวอักษร"; + Text[ czech ] = "Efekty písma"; + Text[ hebrew ] = "Font Effects"; + Text[ hindi ] = "फ़ॉन्ट् प्रभाव"; + Text[ slovak ] = "Efekty pre písmo"; +*/ + +#define PAGE_DATALABELS \ +PageItem \ +{ \ + Identifier = TP_DATA_DESCR ; \ + PageResID = TP_DATA_DESCR ; \ + Text = "Datenbeschriftung" ; \ +}; +/* + Text [ ENGLISH ] = "Data Descritption" ; + Text [ english_us ] = "Data Labels" ; + Text [ norwegian ] = "Data Descritption" ; + Text [ italian ] = "Dicitura dati" ; + Text [ portuguese_brazilian ] = "Rtulos dos Dados" ; + Text [ portuguese ] = "Legenda para dados" ; + Text [ finnish ] = "Tietoselitteet" ; + Text [ danish ] = "Dataetiketter" ; + Text [ french ] = "tiquetage des donnes" ; + Text [ swedish ] = "Dataetiketter" ; + Text [ dutch ] = "Gegevenslabels" ; + Text [ spanish ] = "Etiqueta de datos" ; + Text[ chinese_simplified ] = "数据标志"; + Text[ russian ] = " "; + Text[ polish ] = "Etykiety danych"; + Text[ japanese ] = "データラベル"; + Text[ chinese_traditional ] = "資料標籤"; + Text[ arabic ] = " "; + Text[ dutch ] = "Gegevenslabels"; + Text[ chinese_simplified ] = "数据标志"; + Text[ greek ] = " "; + Text[ korean ] = "데이터 레이블"; + Text[ turkish ] = "Veri etiketi"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Etiquetes de dades"; + Text[ thai ] = "ป้ายชื่อข้อมูล"; + Text[ czech ] = "Popisky dat"; + Text[ hebrew ] = "Datenbeschriftung"; + Text[ hindi ] = "ड़ॉटा लेबिलें"; + Text[ slovak ] = "Popisy dát"; +*/ + +#define PAGE_STATISTIC \ +PageItem \ +{ \ + Identifier = TP_STAT ; \ + PageResID = TP_STAT ; \ + Text = "Statistik" ; \ +}; +/* + Text [ ENGLISH ] = "Statistics" ; + Text [ english_us ] = "Statistics" ; + Text [ italian ] = "Statistica" ; + Text [ spanish ] = "Estadstica" ; + Text [ french ] = "Statistiques" ; + Text [ dutch ] = "Statistiek" ; + Text [ swedish ] = "Statistik" ; + Text [ danish ] = "Statistik" ; + Text [ portuguese_brazilian ] = "Estatsticas" ; + Text [ portuguese ] = "Estatstica" ; + Text[ chinese_simplified ] = "统计"; + Text[ russian ] = ""; + Text[ polish ] = "Statystyka"; + Text[ japanese ] = "統計"; + Text[ chinese_traditional ] = "統計"; + Text[ arabic ] = ""; + Text[ dutch ] = "Statistiek"; + Text[ chinese_simplified ] = "统计"; + Text[ greek ] = ""; + Text[ korean ] = "통계"; + Text[ turkish ] = "statistik"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Estadstica"; + Text[ finnish ] = "Tilastotiedot"; + Text[ thai ] = "สถิติ"; + Text[ czech ] = "Statistika"; + Text[ hebrew ] = "סטטיסטיקות"; + Text[ hindi ] = "अँकड़े"; + Text[ slovak ] = "Štatistika"; +*/ + +#define PAGE_LAYOUT \ +PageItem \ +{ \ + Identifier = TP_LAYOUT ; \ + PageResID = TP_LAYOUT ; \ + Text = "Layout" ; \ +}; +/* + Text [ ENGLISH ] = "Layout" ; + Text[ english_us ] = "Layout"; + Text[ italian ] = "Layout"; + Text[ portuguese_brazilian ] = "Layout"; + Text[ portuguese ] = "Layout"; + Text[ danish ] = "Layout"; + Text[ french ] = "Mise en page"; + Text[ swedish ] = "Layout"; + Text[ dutch ] = "Lay-out"; + Text[ spanish ] = "Diseo"; + Text[ chinese_simplified ] = "版式"; + Text[ russian ] = ""; + Text[ polish ] = "Ukad"; + Text[ japanese ] = "レイアウト"; + Text[ chinese_traditional ] = "版式"; + Text[ arabic ] = ""; + Text[ dutch ] = "Lay-out"; + Text[ chinese_simplified ] = "版式"; + Text[ greek ] = ""; + Text[ korean ] = "레이아웃"; + Text[ turkish ] = "Sayfa dzeni"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Format"; + Text[ finnish ] = "Asettelu"; + Text[ thai ] = "เค้าร่าง"; + Text[ czech ] = "Vzhled"; + Text[ hebrew ] = "פריסה"; + Text[ hindi ] = "अभिन्यास"; + Text[ slovak ] = "Formát"; +*/ + +#define PAGE_OPTIONS \ +PageItem \ +{ \ + Identifier = TP_OPTIONS; \ + PageResID = TP_OPTIONS; \ + Text = "Optionen"; \ +}; +/* + Text[ENGLISH] = "Options"; + Text[ english_us ] = "Options"; + Text[ portuguese ] = "Opes"; + Text[ russian ] = ""; + Text[ dutch ] = "Opties"; + Text[ french ] = "Options"; + Text[ spanish ] = "Opciones"; + Text[ italian ] = "Opzioni"; + Text[ danish ] = "Indstillinger"; + Text[ swedish ] = "Alternativ"; + Text[ polish ] = "Opcje"; + Text[ portuguese_brazilian ] = "Opes"; + Text[ japanese ] = "オプション"; + Text[ chinese_simplified ] = "选项"; + Text[ chinese_traditional ] = "選項"; + Text[ arabic ] = ""; + Text[ dutch ] = "Opties"; + Text[ chinese_simplified ] = "选项"; + Text[ greek ] = ""; + Text[ korean ] = "옵션"; + Text[ turkish ] = "Seenekler"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Opcions"; + Text[ finnish ] = "Asetukset"; + Text[ thai ] = "ตัวเลือก"; + Text[ czech ] = "Volby"; + Text[ hebrew ] = "אפשרויות"; + Text[ hindi ] = "विकल्प"; + Text[ slovak ] = "Nastavenia"; +*/ + +#define PAGE_AXISLABEL \ +PageItem \ +{ \ + Identifier = TP_AXIS_LABEL ; \ + PageResID = TP_AXIS_LABEL ; \ + Text = "Beschriftung" ; \ +}; +/* + Text [ ENGLISH ] = "Labelling" ; + Text [ english_us ] = "Label" ; + Text[ portuguese ] = "Legenda"; + Text[ russian ] = ""; + Text[ greek ] = ""; + Text[ dutch ] = "Opschrift"; + Text[ french ] = "tiquette"; + Text[ spanish ] = "Etiqueta"; + Text[ italian ] = "Dicitura"; + Text[ danish ] = "Etiket"; + Text[ swedish ] = "Etikett"; + Text[ polish ] = "Etykieta"; + Text[ portuguese_brazilian ] = "Rtulo"; + Text[ japanese ] = "ラベル"; + Text[ korean ] = "레이블"; + Text[ chinese_simplified ] = "数据标志"; + Text[ chinese_traditional ] = "標籤"; + Text[ arabic ] = ""; + Text[ turkish ] = "Etiket"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Etiqueta"; + Text[ finnish ] = "Selite"; + Text[ thai ] = "ป้ายชื่อ"; + Text[ czech ] = "Popisek"; + Text[ hebrew ] = "Beschriftung"; + Text[ hindi ] = "लेबिल"; + Text[ slovak ] = "Označenie"; +*/ + +#define PAGE_AXISSCALE \ +PageItem \ +{ \ + Identifier = TP_SCALE_Y ; \ + PageResID = TP_SCALE_Y ; \ + Text = "Skalierung" ; \ +}; +/* + Text [ ENGLISH ] = "Scale" ; + Text [ english_us ] = "Scale" ; + Text [ norwegian ] = "Scale" ; + Text [ italian ] = "Scala" ; + Text [ portuguese_brazilian ] = "Escala" ; + Text [ portuguese ] = "Escala" ; + Text [ finnish ] = "Skaalaa" ; + Text [ danish ] = "Skalering" ; + Text [ french ] = "chelle" ; + Text [ swedish ] = "Skalning" ; + Text [ dutch ] = "Schaal" ; + Text [ spanish ] = "Escala" ; + Text[ chinese_simplified ] = "显示比例"; + Text[ russian ] = ""; + Text[ polish ] = "Skala"; + Text[ japanese ] = "目盛"; + Text[ chinese_traditional ] = "顯示比例"; + Text[ arabic ] = ""; + Text[ dutch ] = "Schaal"; + Text[ chinese_simplified ] = "显示比例"; + Text[ greek ] = ""; + Text[ korean ] = "배율 조정"; + Text[ turkish ] = "leklendirme"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Escala"; + Text[ thai ] = "สเกล"; + Text[ czech ] = "Měřítko"; + Text[ hebrew ] = "התאמת גודל"; + Text[ hindi ] = "स्केल"; + Text[ slovak ] = "Pravítko"; +*/ + +#define PAGE_NUMBERFORMAT \ +PageItem \ +{ \ + Identifier = RID_SVXPAGE_NUMBERFORMAT ; \ + PageResID = RID_SVXPAGE_NUMBERFORMAT ; \ + Text = "Zahlen" ; \ +}; +/* + Text [ english_us ] = "Numbers" ; + Text [ ENGLISH ] = "Number" ; + Text [ norwegian ] = "Number" ; + Text [ italian ] = "Numeri" ; + Text [ portuguese_brazilian ] = "Nmeros" ; + Text [ portuguese ] = "Nmeros" ; + Text [ finnish ] = "Luku" ; + Text [ danish ] = "Tal" ; + Text [ french ] = "Nombres" ; + Text [ swedish ] = "Tal" ; + Text [ dutch ] = "Getallen" ; + Text [ spanish ] = "Nmeros" ; + + Text[ chinese_simplified ] = "数字"; + Text[ russian ] = ""; + Text[ polish ] = "Liczby"; + Text[ japanese ] = "数"; + Text[ chinese_traditional ] = "數字"; + Text[ arabic ] = ""; + Text[ dutch ] = "Getallen"; + Text[ chinese_simplified ] = "数字"; + Text[ greek ] = ""; + Text[ korean ] = "숫자"; + Text[ turkish ] = "Saylar"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Nmeros"; + Text[ thai ] = "ตัวเลข"; + Text[ czech ] = "Čísla"; + Text[ hebrew ] = "Zahlen"; + Text[ hindi ] = "संख्या"; + Text[ slovak ] = "Čísla"; +*/ +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +#define BUTTONS \ +OKButton 1 \ +{ \ + Pos = MAP_APPFONT ( 6 , 151 ) ; \ + Size = MAP_APPFONT ( 50 , 14 ) ; \ + TabStop = TRUE ; \ +}; \ +CancelButton 1 \ +{ \ + Pos = MAP_APPFONT ( 60 , 151 ) ; \ + Size = MAP_APPFONT ( 50 , 14 ) ; \ + TabStop = TRUE ; \ +}; \ +HelpButton 1 \ +{ \ + Pos = MAP_APPFONT ( 114 , 151 ) ; \ + Size = MAP_APPFONT ( 50 , 14 ) ; \ + TabStop = TRUE ; \ +}; \ +PushButton 1 \ +{ \ + Pos = MAP_APPFONT ( 169 , 151 ) ; \ + Size = MAP_APPFONT ( 50 , 14 ) ; \ + TabStop = TRUE ; \ + Text = "Zurck" ; \ +}; +/* + Text [ ENGLISH ] = "Return" ; + Text [ norwegian ] = "Return" ; + Text [ italian ] = "Indietro" ; + Text [ portuguese_brazilian ] = "Voltar" ; + Text [ portuguese ] = "Anterior" ; + Text [ finnish ] = "Edellinen" ; + Text [ danish ] = "Tilbage" ; + Text [ french ] = "Prcdent" ; + Text [ swedish ] = "Tillbaka" ; + Text [ dutch ] = "Vorige" ; + Text [ spanish ] = "Regresar" ; + Text [ english_us ] = "Back" ; + Text[ chinese_simplified ] = "返回"; + Text[ russian ] = ""; + Text[ polish ] = "Wstecz"; + Text[ japanese ] = "戻る"; + Text[ chinese_traditional ] = "返回"; + Text[ arabic ] = ""; + Text[ dutch ] = "Vorige"; + Text[ chinese_simplified ] = "返回"; + Text[ greek ] = ""; + Text[ korean ] = "뒤로"; + Text[ turkish ] = "Geri"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Enrere"; + Text[ thai ] = "กลับ"; + Text[ czech ] = "Zpět"; + Text[ hebrew ] = "קודם"; + Text[ hindi ] = "पीछे"; + Text[ slovak ] = "Späť"; +*/ +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_TITLE +{ + // HelpID = SID_CHART_TITLE ; + OutputSize = TRUE ; + SVLook = TRUE ; + Text = "Titel" ; + Text [ ENGLISH ] = "Title" ; + Text [ norwegian ] = "Tittel" ; + Text [ italian ] = "Titolo" ; + Text [ portuguese_brazilian ] = "Ttulo" ; + Text [ portuguese ] = "Ttulo" ; + Text [ finnish ] = "Otsikko" ; + Text [ danish ] = "Titel" ; + Text [ french ] = "Titre" ; + Text [ swedish ] = "Rubrik" ; + Text [ dutch ] = "Titel" ; + Text [ spanish ] = "Ttulo" ; + Text [ english_us ] = "Title" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + PageList = + { + PAGE_LINE + PAGE_AREA + PAGE_TRANSPARENCE + PAGE_CHARACTERS + PAGE_FONTEFFECTS + PageItem + { + Identifier = TP_ALIGNMENT ; + Text = "Ausrichtung" ; + Text [ ENGLISH ] = "Alignment" ; + Text [ norwegian ] = "Alignment" ; + Text [ italian ] = "Allineamento" ; + Text [ portuguese_brazilian ] = "Alinhamento" ; + Text [ portuguese ] = "Alinhamento" ; + Text [ finnish ] = "Tasaus" ; + Text [ danish ] = "Justering" ; + Text [ french ] = "Alignement" ; + Text [ swedish ] = "Justering" ; + Text [ dutch ] = "Uitlijning" ; + Text [ spanish ] = "Alineacin" ; + Text [ english_us ] = "Alignment" ; + PageResID = TP_ALIGNMENT ; + Text[ chinese_simplified ] = "对齐"; + Text[ russian ] = ""; + Text[ polish ] = "Wyrwnanie"; + Text[ japanese ] = "配置"; + Text[ chinese_traditional ] = "對齊"; + Text[ arabic ] = ""; + Text[ dutch ] = "Uitlijning"; + Text[ chinese_simplified ] = "对齐"; + Text[ greek ] = ""; + Text[ korean ] = "맞춤"; + Text[ turkish ] = "Hizalama"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Alineament"; + Text[ thai ] = "จัดตำแหน่ง"; + Text[ czech ] = "Zarovnání"; + Text[ hebrew ] = "ישור"; + Text[ hindi ] = "Alignment"; + Text[ slovak ] = "Zarovnanie"; + }; + }; + }; +//// BUTTONS + Text[ chinese_simplified ] = "标题"; + Text[ russian ] = ""; + Text[ polish ] = "Tytu"; + Text[ japanese ] = "タイトル"; + Text[ chinese_traditional ] = "標題"; + Text[ arabic ] = ""; + Text[ dutch ] = "Titel"; + Text[ chinese_simplified ] = "标题"; + Text[ greek ] = ""; + Text[ korean ] = "제목"; + Text[ turkish ] = "Balk"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Ttol"; + Text[ thai ] = "ชื่อ"; + Text[ czech ] = "Titul"; + Text[ hebrew ] = "כותקת"; + Text[ hindi ] = "शीर्षक"; + Text[ slovak ] = "Nadpis"; +}; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_LEGEND +{ + // HelpID = SID_LEGEND ; + OutputSize = TRUE ; + SVLook = TRUE ; + Text = "Legende" ; + Text [ ENGLISH ] = "Legend" ; + Text [ norwegian ] = "Legend" ; + Text [ italian ] = "Legenda" ; + Text [ portuguese_brazilian ] = "Legenda" ; + Text [ portuguese ] = "Legenda" ; + Text [ finnish ] = "Selite" ; + Text [ danish ] = "Forklaring" ; + Text [ french ] = "Lgende" ; + Text [ swedish ] = "Frklaring" ; + Text [ dutch ] = "Legenda" ; + Text [ spanish ] = "Leyenda" ; + Text [ english_us ] = "Legend" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + PageList = + { + PAGE_LINE + PAGE_AREA + PAGE_TRANSPARENCE + PAGE_CHARACTERS + PAGE_FONTEFFECTS + PageItem + { + Identifier = TP_LEGEND_POS ; + Text = "Anordnung" ; + Text [ ENGLISH ] = "Arrangement" ; + Text [ norwegian ] = "Arrangement" ; + Text [ italian ] = "Disponi" ; + Text [ portuguese_brazilian ] = "Posio" ; + Text [ portuguese ] = "Disposio" ; + Text [ finnish ] = "Sijainti" ; + Text [ danish ] = "Placering" ; + Text [ french ] = "Disposition" ; + Text [ swedish ] = "Placering" ; + Text [ dutch ] = "Positie" ; + Text [ spanish ] = "Posicin" ; + Text [ english_us ] = "Position" ; + PageResID = TP_LEGEND_POS ; + Text[ chinese_simplified ] = "排序"; + Text[ russian ] = ""; + Text[ polish ] = "Pozycja"; + Text[ japanese ] = "配置"; + Text[ chinese_traditional ] = "排序"; + Text[ arabic ] = ""; + Text[ dutch ] = "Positie"; + Text[ chinese_simplified ] = "排序"; + Text[ greek ] = ""; + Text[ korean ] = "위치"; + Text[ turkish ] = "Konum"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Posici"; + Text[ thai ] = "ตำแหน่ง"; + Text[ czech ] = "Umístění"; + Text[ hebrew ] = "מיקום"; + Text[ hindi ] = "स्थान"; + Text[ slovak ] = "Umiestnenie"; + }; + }; + }; +//// BUTTONS + Text[ chinese_simplified ] = "图例"; + Text[ russian ] = ""; + Text[ polish ] = "Legenda"; + Text[ japanese ] = "凡例"; + Text[ chinese_traditional ] = "圖例"; + Text[ arabic ] = " "; + Text[ dutch ] = "Legenda"; + Text[ chinese_simplified ] = "图例"; + Text[ greek ] = ""; + Text[ korean ] = "범례"; + Text[ turkish ] = "Aklama"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Llegenda"; + Text[ thai ] = "คำอธิบาย"; + Text[ czech ] = "Legenda"; + Text[ hebrew ] = "Legende"; + Text[ hindi ] = "लेजेन्ड़"; + Text[ slovak ] = "Legenda"; +}; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_DATA_ROW +{ + // HelpID = HID_SCH_DATA_ROW ; + OutputSize = TRUE ; + SVLook = TRUE ; + Text = "Datenreihe" ; + Text [ ENGLISH ] = "Data Row" ; + Text [ norwegian ] = "Data Row" ; + Text [ italian ] = "Serie di dati" ; + Text [ portuguese_brazilian ] = "Srie de Dados" ; + Text [ portuguese ] = "Srie de dados" ; + Text [ finnish ] = "Tietojoukot" ; + Text [ danish ] = "Dataserie" ; + Text [ french ] = "Srie de donnes" ; + Text [ swedish ] = "Dataserie" ; + Text [ dutch ] = "Gegevensreeks" ; + Text [ spanish ] = "Serie de datos" ; + Text [ english_us ] = "Data Series" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + PageList = + { + PAGE_LINE + PAGE_AREA + PAGE_TRANSPARENCE + PAGE_CHARACTERS + PAGE_FONTEFFECTS + PAGE_DATALABELS + PAGE_STATISTIC + PAGE_LAYOUT + PAGE_OPTIONS + }; + }; +// BUTTONS + Text[ chinese_simplified ] = "数据组"; + Text[ russian ] = " "; + Text[ polish ] = "Seria danych"; + Text[ japanese ] = "データ系列"; + Text[ chinese_traditional ] = "數據欄"; + Text[ arabic ] = " "; + Text[ dutch ] = "Gegevensreeks"; + Text[ chinese_simplified ] = "数据组"; + Text[ greek ] = " "; + Text[ korean ] = "연속 데이터 "; + Text[ turkish ] = "Veri dizisi"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Srie de dades"; + Text[ thai ] = "ชุดข้อมูล"; + Text[ czech ] = "Datová řada"; + Text[ hebrew ] = "Datenreihe"; + Text[ hindi ] = "ड़ॉटा श्रृंखला"; + Text[ slovak ] = "Dátová rada"; +}; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +/* +TabDialog TAB_DATA_LINE +{ + // HelpID = HID_SCH_DATA_LINE ; + OutputSize = TRUE ; + SVLook = TRUE ; + Text = "Datenreihe" ; + Text [ ENGLISH ] = "Data Row" ; + Text [ norwegian ] = "Data Row" ; + Text [ italian ] = "Serie di dati" ; + Text [ portuguese_brazilian ] = "Srie de Dados" ; + Text [ portuguese ] = "Srie de dados" ; + Text [ finnish ] = "Tietojoukot" ; + Text [ danish ] = "Dataserie" ; + Text [ french ] = "Srie de donnes" ; + Text [ swedish ] = "Dataserie" ; + Text [ dutch ] = "Gegevensreeks" ; + Text [ spanish ] = "Serie de datos" ; + Text [ english_us ] = "Data Series" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + PageList = + { + PAGE_LINE + PAGE_CHARACTERS + PAGE_FONTEFFECTS + PAGE_DATALABELS + PAGE_STATISTIC + PAGE_OPTIONS + }; + }; +//// BUTTONS + Text[ chinese_simplified ] = "数据组"; + Text[ russian ] = " "; + Text[ polish ] = "Seria danych"; + Text[ japanese ] = "データ系列"; + Text[ chinese_traditional ] = "數據欄"; + Text[ arabic ] = " "; + Text[ dutch ] = "Gegevensreeks"; + Text[ chinese_simplified ] = "数据组"; + Text[ greek ] = " "; + Text[ korean ] = "연속 데이터"; + Text[ turkish ] = "Veri dizisi"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Srie de dades"; + Text[ thai ] = "ชุดข้อมูล"; + Text[ czech ] = "Datová řada"; + Text[ hebrew ] = "Datenreihe"; + Text[ hindi ] = "ड़ॉटा श्रृंखला"; + Text[ slovak ] = "Dátové rady"; +}; +*/ +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_DATA_POINT +{ + // HelpID = HID_SCH_DATA_POINT ; + OutputSize = TRUE ; + SVLook = TRUE ; + Text = "Datenpunkt" ; + Text [ ENGLISH ] = "Data Point" ; + Text [ norwegian ] = "Data Point" ; + Text [ italian ] = "Punto dati" ; + Text [ portuguese_brazilian ] = "Ponto de dados" ; + Text [ portuguese ] = "Ponto de dados" ; + Text [ finnish ] = "Arvopiste" ; + Text [ danish ] = "Datapunkt" ; + Text [ french ] = "Point de donnes" ; + Text [ swedish ] = "Datapunkt" ; + Text [ dutch ] = "Gegevenspunt" ; + Text [ spanish ] = "Punto de datos" ; + Text [ english_us ] = "Data Point" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + PageList = + { + PAGE_LINE + PAGE_AREA + PAGE_TRANSPARENCE + PAGE_CHARACTERS + PAGE_FONTEFFECTS + PAGE_DATALABELS + PAGE_STATISTIC + PAGE_LAYOUT + }; + }; +//// BUTTONS + Text[ chinese_simplified ] = "数据点"; + Text[ russian ] = " "; + Text[ polish ] = "Punkt danych"; + Text[ japanese ] = "データポイント"; + Text[ chinese_traditional ] = "資料點"; + Text[ arabic ] = " "; + Text[ dutch ] = "Gegevenspunt"; + Text[ chinese_simplified ] = "数据点"; + Text[ greek ] = " "; + Text[ korean ] = "데이터 포인트"; + Text[ turkish ] = "Veri noktas"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Punt de dades"; + Text[ thai ] = "จุดข้อมูล"; + Text[ czech ] = "Datový bod"; + Text[ hebrew ] = "Datenpunkt"; + Text[ hindi ] = "ड़ॉटा बिंदु"; + Text[ slovak ] = "Dátový bod"; +}; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_LINE +{ + // HelpID = SID_DIAGRAM_GRID ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 289 , 176 ) ; + Text = "Linien" ; + Text [ ENGLISH ] = "Lines" ; + Text [ english_us ] = "Lines" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 3 , 3 ) ; + Size = MAP_APPFONT ( 260 , 135 ) ; + PageList = + { + PAGE_LINE + }; + }; +//// BUTTONS + Text [ italian ] = "Linee" ; + Text [ spanish ] = "Lneas" ; + Text [ french ] = "Lignes" ; + Text [ dutch ] = "Lijnen" ; + Text [ swedish ] = "Linjer" ; + Text [ danish ] = "Linjer" ; + Text [ portuguese ] = "Linhas" ; + Text [ portuguese_brazilian ] = "Linhas" ; + Text[ chinese_simplified ] = "线条"; + Text[ russian ] = ""; + Text[ polish ] = "Linie"; + Text[ japanese ] = "軸"; + Text[ chinese_traditional ] = "線條"; + Text[ arabic ] = ""; + Text[ dutch ] = "Lijnen"; + Text[ chinese_simplified ] = "线条"; + Text[ greek ] = ""; + Text[ korean ] = "선"; + Text[ turkish ] = "izgi"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Lnies"; + Text[ finnish ] = "Rivit"; + Text[ thai ] = "บรรทัด"; + Text[ czech ] = "Řádky"; + Text[ hebrew ] = "Linien"; + Text[ hindi ] = "रेखा"; + Text[ slovak ] = "Riadky"; +}; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_DIAGRAM_STOCK_LOSS +{ + OutputSize = TRUE ; + SVLook = TRUE ; + Text = "Negative Abweichung" ; + Text [ ENGLISH ] = "negativ deviation" ; + Moveable = TRUE ; + TabControl 1 + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 3 , 3 ) ; + PageList = + { + PAGE_LINE + PAGE_AREA + PAGE_TRANSPARENCE + }; + }; +//// BUTTONS + Text[ italian ] = "Deviazione negativa"; + Text[ portuguese_brazilian ] = "Desvio negativo"; + Text[ portuguese ] = "Desvio negativo"; + Text[ danish ] = "Negativ afvigelse"; + Text[ french ] = "Dviation ngative"; + Text[ swedish ] = "Negativ avvikelse"; + Text[ dutch ] = "Negatieve deviatie"; + Text[ spanish ] = "Desviacin negativa"; + Text[ english_us ] = "Negative deviation"; + Text[ chinese_simplified ] = "负值偏差"; + Text[ russian ] = " "; + Text[ polish ] = "Odchylenie ujemne"; + Text[ japanese ] = "マイナス偏差"; + Text[ chinese_traditional ] = "負值偏差"; + Text[ arabic ] = " "; + Text[ dutch ] = "Negatieve deviatie"; + Text[ chinese_simplified ] = "负值偏差"; + Text[ greek ] = " "; + Text[ korean ] = "음수 편차"; + Text[ turkish ] = "Negatif sapma"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Desviaci negativa"; + Text[ finnish ] = "Negatiivinen poikkeama"; + Text[ thai ] = "ค่าเบี่ยงเบนบวก"; + Text[ czech ] = "Záporná odchylka"; + Text[ hebrew ] = "Negative Abweichung"; + Text[ hindi ] = "Negative deviation"; + Text[ slovak ] = "Záporná odchýlka"; +}; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_DIAGRAM_STOCK_PLUS +{ + OutputSize = TRUE ; + SVLook = TRUE ; + Text = "Positive Abweichung" ; + Text [ ENGLISH ] = "positive deviation" ; + Moveable = TRUE ; + TabControl 1 + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 3 , 3 ) ; + PageList = + { + PAGE_LINE + PAGE_AREA + PAGE_TRANSPARENCE + }; + }; +//// BUTTONS + Text[ italian ] = "Deviazione positiva"; + Text[ portuguese_brazilian ] = "Desvio positivo"; + Text[ portuguese ] = "Desvio positivo"; + Text[ danish ] = "Positiv afvigelse"; + Text[ french ] = "Dviation positive"; + Text[ swedish ] = "Positiv avvikelse"; + Text[ dutch ] = "Positieve deviatie"; + Text[ spanish ] = "Desviacin positiva"; + Text[ english_us ] = "Positive deviation"; + Text[ chinese_simplified ] = "正值偏差"; + Text[ russian ] = " "; + Text[ polish ] = "Odchylenie dodatnie"; + Text[ japanese ] = "プラス偏差"; + Text[ chinese_traditional ] = "正值偏差"; + Text[ arabic ] = " "; + Text[ dutch ] = "Positieve deviatie"; + Text[ chinese_simplified ] = "正值偏差"; + Text[ greek ] = " "; + Text[ korean ] = "양수 편차"; + Text[ turkish ] = "Pozitif sapma"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Desviaci positiva"; + Text[ finnish ] = "Positiivinen poikkeama"; + Text[ thai ] = "ค่าเบี่ยงเบนบวก"; + Text[ czech ] = "Kladná odchylka"; + Text[ hebrew ] = "Positive Abweichung"; + Text[ hindi ] = "धनात्मक डीविएशन"; + Text[ slovak ] = "Kladná odchýlka"; +}; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_AXIS +{ + // HelpID = HID_SCH_DIAGRAM_Y_AXIS ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 289 , 176 ) ; + Text = "Achse" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog has Cancel and/or OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 3 , 3 ) ; + Size = MAP_APPFONT ( 260 , 135 ) ; + PageList = + { + PAGE_LINE + PAGE_CHARACTERS + PAGE_FONTEFFECTS + PAGE_AXISSCALE + PAGE_NUMBERFORMAT + PAGE_AXISLABEL + }; + }; +//// BUTTONS +}; +/* +TabDialog TAB_AXIS +{ + // HelpID = SID_DIAGRAM_AXIS ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 289 , 176 ) ; + Text = "Achsen" ; + Text [ ENGLISH ] = "Axis" ; + Text [ norwegian ] = "Axis" ; + Text [ italian ] = "Asse" ; + Text [ portuguese_brazilian ] = "Eixos" ; + Text [ portuguese ] = "Eixos" ; + Text [ finnish ] = "Akselit" ; + Text [ danish ] = "Akser" ; + Text [ french ] = "Axes" ; + Text [ swedish ] = "Axlar" ; + Text [ dutch ] = "Assen" ; + Text [ spanish ] = "Ejes" ; + Text [ english_us ] = "Axes" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 3 , 3 ) ; + Size = MAP_APPFONT ( 260 , 135 ) ; + PageList = + { + PAGE_LINE + PAGE_CHARACTERS + PAGE_FONTEFFECTS + PAGE_AXISLABEL + }; + }; +//// BUTTONS + Text[ chinese_simplified ] = "轴"; + Text[ russian ] = ""; + Text[ polish ] = "Osie"; + Text[ japanese ] = "軸"; + Text[ chinese_traditional ] = "軸"; + Text[ arabic ] = ""; + Text[ dutch ] = "Assen"; + Text[ chinese_simplified ] = "轴"; + Text[ greek ] = ""; + Text[ korean ] = "축"; + Text[ turkish ] = "Eksen"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Eixos"; + Text[ thai ] = "แกน"; + Text[ czech ] = "Osy"; + Text[ hebrew ] = "Achsen"; + Text[ hindi ] = "अक्ष रेखाएँ"; + Text[ slovak ] = "Osi"; +}; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_X_AXIS +{ + // HelpID = HID_SCH_DIAGRAM_X_AXIS ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 289 , 176 ) ; + Text = "X-Achse" ; + Text [ ENGLISH ] = "X-Axis" ; + Text [ norwegian ] = "X-Axis" ; + Text [ italian ] = "Asse X" ; + Text [ portuguese_brazilian ] = "Eixo X" ; + Text [ portuguese ] = "Eixo X" ; + Text [ finnish ] = "X-akseli" ; + Text [ danish ] = "X-akse" ; + Text [ french ] = "Axe X" ; + Text [ swedish ] = "X-axel" ; + Text [ dutch ] = "X-as" ; + Text [ spanish ] = "Eje X" ; + Text [ english_us ] = "X Axis" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 3 , 3 ) ; + Size = MAP_APPFONT ( 260 , 135 ) ; + PageList = + { + PAGE_LINE + PAGE_CHARACTERS + PAGE_FONTEFFECTS + PAGE_AXISSCALE + PAGE_NUMBERFORMAT + PAGE_AXISLABEL + }; + }; +//// BUTTONS + Text[ chinese_simplified ] = "X 轴数值"; + Text[ russian ] = " X"; + Text[ polish ] = "O X"; + Text[ japanese ] = "X軸"; + Text[ chinese_traditional ] = "X 軸"; + Text[ arabic ] = " "; + Text[ dutch ] = "X-as"; + Text[ chinese_simplified ] = "X 轴数值"; + Text[ greek ] = " X"; + Text[ korean ] = "X 축"; + Text[ turkish ] = "X ekseni"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Eix X"; + Text[ thai ] = "แกนX "; + Text[ czech ] = "Osa X"; + Text[ hebrew ] = "X-Achse"; + Text[ hindi ] = "X अक्ष"; + Text[ slovak ] = "Os X"; +}; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_Y_AXIS +{ + // HelpID = HID_SCH_DIAGRAM_Y_AXIS ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 289 , 176 ) ; + Text = "Y-Achse" ; + Text [ ENGLISH ] = "Y-Axis" ; + Text [ norwegian ] = "Y-Axis" ; + Text [ italian ] = "Asse Y" ; + Text [ portuguese_brazilian ] = "Eixo Y" ; + Text [ portuguese ] = "Eixo Y" ; + Text [ finnish ] = "Y-akseli" ; + Text [ danish ] = "Y-akse" ; + Text [ french ] = "Axe Y" ; + Text [ swedish ] = "Y-axel" ; + Text [ dutch ] = "Y-as" ; + Text [ spanish ] = "Eje Y" ; + Text [ english_us ] = "Y Axis" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 3 , 3 ) ; + Size = MAP_APPFONT ( 260 , 135 ) ; + PageList = + { + PAGE_LINE + PAGE_CHARACTERS + PAGE_FONTEFFECTS + PAGE_AXISSCALE + PAGE_NUMBERFORMAT + PAGE_AXISLABEL + }; + }; +//// BUTTONS + Text[ chinese_simplified ] = "Y 轴数值"; + Text[ russian ] = " Y"; + Text[ polish ] = "O Y"; + Text[ japanese ] = "Y軸"; + Text[ chinese_traditional ] = "Y 軸"; + Text[ arabic ] = " "; + Text[ dutch ] = "Y-as"; + Text[ chinese_simplified ] = "Y 轴数值"; + Text[ greek ] = " Y"; + Text[ korean ] = "Y 축"; + Text[ turkish ] = "Y ekseni"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Eix Y"; + Text[ thai ] = "แกนY "; + Text[ czech ] = "Osa Y"; + Text[ hebrew ] = "Y-Achse"; + Text[ hindi ] = "Y अक्ष"; + Text[ slovak ] = "Os Y"; +}; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_Z_AXIS +{ + // HelpID = SID_DIAGRAM_AXIS ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 289 , 176 ) ; + Text = "Z-Achse" ; + Text [ ENGLISH ] = "Z-Axis" ; + Text [ norwegian ] = "Z-Axis" ; + Text [ italian ] = "Asse Z" ; + Text [ portuguese_brazilian ] = "Eixo Z" ; + Text [ portuguese ] = "Eixo Z" ; + Text [ finnish ] = "Z-akseli" ; + Text [ danish ] = "Z-akse" ; + Text [ french ] = "Axe Z" ; + Text [ swedish ] = "Z-axel" ; + Text [ dutch ] = "Z-as" ; + Text [ spanish ] = "Eje Z" ; + Text [ english_us ] = "Z Axis" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 3 , 3 ) ; + Size = MAP_APPFONT ( 260 , 135 ) ; + PageList = + { + PAGE_LINE + PAGE_CHARACTERS + PAGE_FONTEFFECTS + PAGE_AXISLABEL + }; + }; +//// BUTTONS + Text[ chinese_simplified ] = "Z 轴"; + Text[ russian ] = " Z"; + Text[ polish ] = "O Z"; + Text[ japanese ] = "Z軸"; + Text[ chinese_traditional ] = "Z 軸"; + Text[ arabic ] = " "; + Text[ dutch ] = "Z-as"; + Text[ chinese_simplified ] = "Z 轴"; + Text[ greek ] = " Z"; + Text[ korean ] = "Z 축"; + Text[ turkish ] = "Z ekseni"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Eix Z"; + Text[ thai ] = "แกนZ "; + Text[ czech ] = "Osa Z"; + Text[ hebrew ] = "Z-Achse"; + Text[ hindi ] = "Z अक्ष"; + Text[ slovak ] = "Os Z"; +}; +*/ +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_GRID +{ + // HelpID = SID_DIAGRAM_GRID ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 289 , 176 ) ; + Text = "Gitter" ; + Text [ ENGLISH ] = "Grid" ; + Text [ norwegian ] = "Grid" ; + Text [ italian ] = "Griglia" ; + Text [ portuguese_brazilian ] = "Grade" ; + Text [ portuguese ] = "Grelha" ; + Text [ finnish ] = "Ruudukko" ; + Text [ danish ] = "Gitter" ; + Text [ french ] = "Grille" ; + Text [ swedish ] = "Gitter" ; + Text [ dutch ] = "Raster" ; + Text [ spanish ] = "Cuadrcula" ; + Text [ english_us ] = "Grid" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 3 , 3 ) ; + Size = MAP_APPFONT ( 260 , 135 ) ; + PageList = + { + PAGE_LINE + }; + }; +//// BUTTONS + Text[ chinese_simplified ] = "网格线"; + Text[ russian ] = ""; + Text[ polish ] = "Siatka"; + Text[ japanese ] = "目盛線"; + Text[ chinese_traditional ] = "網格"; + Text[ arabic ] = ""; + Text[ dutch ] = "Raster"; + Text[ chinese_simplified ] = "网格线"; + Text[ greek ] = ""; + Text[ korean ] = "눈금선"; + Text[ turkish ] = "Klavuz izgiler"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Graella"; + Text[ thai ] = "เส้นตาราง"; + Text[ czech ] = "Mřížka"; + Text[ hebrew ] = "Gitter"; + Text[ hindi ] = "जाल"; + Text[ slovak ] = "Mriežka"; +}; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_DIAGRAM_WALL +{ + // HelpID = SID_DIAGRAM_WALL ; + OutputSize = TRUE ; + SVLook = TRUE ; + Text = "Diagrammwand" ; + Text [ ENGLISH ] = "Diagram Wall" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + SVLook = TRUE ; + Pos = MAP_APPFONT ( 6 , 3 ) ; + PageList = + { + PAGE_LINE + PAGE_AREA + PAGE_TRANSPARENCE + }; + }; +// BUTTONS + Text[ italian ] = "Pareti del diagramma"; + Text[ portuguese_brazilian ] = "Parede do Grfico"; + Text[ portuguese ] = "Parede do grfico"; + Text[ danish ] = "Diagramvg"; + Text[ french ] = "Paroi du diagramme"; + Text[ swedish ] = "Diagramvgg"; + Text[ dutch ] = "Diagramwand"; + Text[ spanish ] = "Plano lateral"; + Text[ english_us ] = "Chart Wall"; + Text[ chinese_simplified ] = "图表背景墙"; + Text[ russian ] = " "; + Text[ polish ] = "ciana wykresu"; + Text[ japanese ] = "グラフの壁面"; + Text[ chinese_traditional ] = "圖表背景牆"; + Text[ arabic ] = " "; + Text[ dutch ] = "Diagramwand"; + Text[ chinese_simplified ] = "图表背景墙"; + Text[ greek ] = " "; + Text[ korean ] = "차트 옆면"; + Text[ turkish ] = "ema duvar"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Pla lateral del diagrama"; + Text[ finnish ] = "Kaaviosein"; + Text[ thai ] = "ผนังแผนภูมิ"; + Text[ czech ] = "Stěna grafu"; + Text[ hebrew ] = "Diagrammwand"; + Text[ hindi ] = "Chart Wall"; + Text[ slovak ] = "Bok grafu"; +}; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_DIAGRAM_FLOOR +{ + // HelpID = SID_DIAGRAM_FLOOR ; + OutputSize = TRUE ; + SVLook = TRUE ; + Text = "Diagrammboden" ; + Text [ ENGLISH ] = "Diagram Floor" ; + Text [ norwegian ] = "Diagram Floor" ; + Text [ italian ] = "Pavimento del diagramma" ; + Text [ portuguese_brazilian ] = "Piso do Grfico" ; + Text [ portuguese ] = "Base do grfico" ; + Text [ finnish ] = "Kaavion perusta" ; + Text [ danish ] = "Diagramgulv" ; + Text [ french ] = "Plancher du diagramme" ; + Text [ swedish ] = "Diagramgolv" ; + Text [ dutch ] = "Diagrambodem" ; + Text [ spanish ] = "Base del diagrama" ; + Text [ english_us ] = "Chart Floor" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 3 , 3 ) ; + PageList = + { + PAGE_LINE + PAGE_AREA + PAGE_TRANSPARENCE + }; + }; +//// BUTTONS + Text[ chinese_simplified ] = "图表基底"; + Text[ russian ] = " "; + Text[ polish ] = "Podstawa wykresu"; + Text[ japanese ] = "グラフの床面"; + Text[ chinese_traditional ] = "座標軸"; + Text[ arabic ] = " "; + Text[ dutch ] = "Diagrambodem"; + Text[ chinese_simplified ] = "图表基底"; + Text[ greek ] = " "; + Text[ korean ] = "차트 밑면"; + Text[ turkish ] = "ema taban"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Base del diagrama"; + Text[ thai ] = "พื้นแผนภูมิ"; + Text[ czech ] = "Pata grafu"; + Text[ hebrew ] = "Diagrammboden"; + Text[ hindi ] = "चार्ट फ्लोर"; + Text[ slovak ] = "Päta grafu"; +}; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +TabDialog TAB_DIAGRAM_AREA +{ + // HelpID = SID_DIAGRAM_AREA ; + OutputSize = TRUE ; + SVLook = TRUE ; + Text = "Diagrammflche" ; + Text [ ENGLISH ] = "Diagram Area" ; + Text [ norwegian ] = "Diagram Area" ; + Text [ italian ] = "Area del diagramma" ; + Text [ portuguese_brazilian ] = "rea do Grfico" ; + Text [ portuguese ] = "rea do grfico" ; + Text [ finnish ] = "Kaavioalue" ; + Text [ danish ] = "Diagramomrde" ; + Text [ french ] = "Arrire-plan du diagramme" ; + Text [ swedish ] = "Diagramomrde" ; + Text [ dutch ] = "Diagramoppervlak" ; + Text [ spanish ] = "Superficie del diagrama" ; + Text [ english_us ] = "Chart Area" ; + Moveable = TRUE ; + // Closeable = TRUE; // Dialog hat Cancel und/oder OK-Button ! (KH) + TabControl 1 + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 3 , 3 ) ; + PageList = + { + PAGE_LINE + PAGE_AREA + PAGE_TRANSPARENCE + }; + }; +//// BUTTONS + Text[ chinese_simplified ] = "图表区"; + Text[ russian ] = " "; + Text[ polish ] = "Obszar wykresu"; + Text[ japanese ] = "グラフエリア"; + Text[ chinese_traditional ] = "圖表平面"; + Text[ arabic ] = " "; + Text[ dutch ] = "Diagramoppervlak"; + Text[ chinese_simplified ] = "图表区"; + Text[ greek ] = " "; + Text[ korean ] = "차트 영역"; + Text[ turkish ] = "ema yzeyi"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "rea del diagrama"; + Text[ thai ] = "พื้นที่แผนภูมิ"; + Text[ czech ] = "Plocha grafu"; + Text[ hebrew ] = "Diagrammfläche"; + Text[ hindi ] = "Chart Area"; + Text[ slovak ] = "Plocha grafu"; +}; diff --git a/chart2/source/controller/dialogs/makefile.mk b/chart2/source/controller/dialogs/makefile.mk new file mode 100644 index 000000000000..170bd37bfff8 --- /dev/null +++ b/chart2/source/controller/dialogs/makefile.mk @@ -0,0 +1,129 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ= ..$/..$/.. +PRJINC= $(PRJ)$/source +PRJNAME= chart2 +TARGET= chcdialogs + +ENABLE_EXCEPTIONS= TRUE +#GEN_HID= TRUE + +#BMP_IN=$(PRJ)$/res + +# --- Settings ----------------------------------------------------- + +.INCLUDE: settings.mk + +# --- export library ------------------------------------------------- + +#object files to build and link together to lib $(SLB)$/$(TARGET).lib +SLOFILES= $(SLO)$/tp_AxisLabel.obj \ + $(SLO)$/tp_DataLabel.obj \ + $(SLO)$/tp_LegendPosition.obj \ + $(SLO)$/tp_PointGeometry.obj \ + $(SLO)$/tp_Scale.obj \ + $(SLO)$/tp_SeriesStatistic.obj \ + $(SLO)$/tp_SeriesToAxis.obj \ + $(SLO)$/tp_TitleRotation.obj \ + $(SLO)$/dlg_ObjectProperties.obj \ + $(SLO)$/dlg_ChartType.obj \ + $(SLO)$/dlg_InsertAxis_Grid.obj \ + $(SLO)$/dlg_InsertDataLabel.obj \ + $(SLO)$/dlg_InsertLegend.obj \ + $(SLO)$/dlg_InsertStatistic.obj \ + $(SLO)$/dlg_InsertTitle.obj + +# --- Resources --------------------------------------------------------------- + +# Bitmaps.src +# Bitmaps_HC.src + + +SRC1FILES= \ + tp_AxisLabel.src \ + tp_DataLabel.src \ + tp_LegendPosition.src \ + tp_PointGeometry.src \ + tp_Scale.src \ + tp_SeriesStatistic.src \ + tp_SeriesToAxis.src \ + tp_TitleRotation.src \ + dlg_ObjectProperties.src \ + Strings_Statistic.src \ + Strings_Scale.src \ + Strings_ChartTypes.src \ + Strings.src \ + dlg_ChartType.src \ + Bitmaps.src \ + Bitmaps_HC.src \ + dlg_InsertAxis_Grid.src \ + dlg_InsertDataLabel.src \ + dlg_InsertLegend.src \ + dlg_InsertStatistic.src \ + dlg_InsertTitle.src + +SRS1NAME=$(TARGET) + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx new file mode 100644 index 000000000000..3c5ee1d52841 --- /dev/null +++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx @@ -0,0 +1,416 @@ +/************************************************************************* + * + * $RCSfile: tp_AxisLabel.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "tp_AxisLabel.hxx" + +#include "ResId.hxx" +#include "TabPages.hrc" +#include "SchSfxItemIds.hxx" +#include "SchSlotIds.hxx" + +#define ITEMID_CHARTTEXTORDER SCHATTR_TEXT_ORDER +// #define ITEMID_CHARTTEXTORIENT SCHATTR_TEXT_ORIENT +// header for SvxChartTextOrientItem / SvxChartTextOrderItem +#ifndef _SVX_CHRTITEM_HXX +#include <svx/chrtitem.hxx> +#endif + +/* +#ifndef _SFXITEMSET_HXX +#include <svtools/itemset.hxx> +#endif +*/ +// header for SfxInt32Item +#ifndef _SFXINTITEM_HXX +#include <svtools/intitem.hxx> +#endif +/* +// header for SfxBoolItem +#ifndef _SFXENUMITEM_HXX +#include <svtools/eitem.hxx> +#endif + +#include "schattr.hxx" +#define ITEMID_CHARTTEXTORDER SCHATTR_TEXT_ORDER +#define ITEMID_CHARTTEXTORIENT SCHATTR_TEXT_ORIENT +// header for SvxChartTextOrientItem / SvxChartTextOrderItem +#ifndef _SVX_CHRTITEM_HXX +#include <svx/chrtitem.hxx> +#endif + +#include "chtmodel.hxx" +#include "schresid.hxx" +#include "app.hrc" + +#include "tplabel.hxx" +#include "tplabel.hrc" +*/ +//............................................................................. +namespace chart +{ +//............................................................................. + +SchAxisLabelTabPage::SchAxisLabelTabPage( Window* pParent, const SfxItemSet& rInAttrs ) : + SfxTabPage( pParent, SchResId( TP_AXIS_LABEL ), rInAttrs ), + + aCbShowDescription( this, SchResId( CB_AXIS_LABEL_SCHOW_DESCR ) ), + + aWOAngle( this, + SchResId( CT_AXIS_LABEL_DIAL ), + SchResId( PB_AXIS_LABEL_TEXTSTACKED ), + SchResId( FT_AXIS_LABEL_DEGREES ), + SchResId( NF_AXIS_LABEL_ORIENT ), + SchResId( FT_UNUSED ), + SchResId( CT_UNUSED ), + SchResId( FL_AXIS_LABEL_ORIENTATION ) ), + + aFlTextFlow( this, SchResId( FL_AXIS_LABEL_TEXTFLOW ) ), + aCbTextOverlap( this, SchResId( CB_AXIS_LABEL_TEXTOVERLAP ) ), + aCbTextBreak( this, SchResId( CB_AXIS_LABEL_TEXTBREAK ) ), + + aFlOrder( this, SchResId( FL_AXIS_LABEL_ORDER ) ), + aRbSideBySide( this, SchResId( RB_AXIS_LABEL_SIDEBYSIDE ) ), + aRbUpDown( this, SchResId( RB_AXIS_LABEL_UPDOWN ) ), + aRbDownUp( this, SchResId( RB_AXIS_LABEL_DOWNUP ) ), + aRbAuto( this, SchResId( RB_AXIS_LABEL_AUTOORDER ) ), + + aFlSeparator( this, SchResId( FL_SEPARATOR ) ), + + bShowStaggeringControls( true ), +//// bAllowTextOverlap( TRUE ), + + m_nInitialDegrees( 0 ), + m_bInitialStacking( FALSE ) +{ + FreeResource(); + + aCbShowDescription.SetClickHdl( LINK( this, SchAxisLabelTabPage, ToggleShowLabel ) ); + + // Make the fixed line separator vertical. + aFlSeparator.SetStyle (aFlSeparator.GetStyle() | WB_VERT); + + Construct(); +} + +SchAxisLabelTabPage::~SchAxisLabelTabPage() +{} + +void SchAxisLabelTabPage::Construct() +{ +} + + +SfxTabPage* SchAxisLabelTabPage::Create( Window* pParent, const SfxItemSet& rAttrs ) +{ + return new SchAxisLabelTabPage( pParent, rAttrs ); +} + +BOOL SchAxisLabelTabPage::FillItemSet( SfxItemSet& rOutAttrs ) +{ +// SvxChartTextOrient eOrient; + BOOL bIsStacked = FALSE; + long nDegrees = aWOAngle.GetDegrees() * 100L; + + if( nDegrees != m_nInitialDegrees ) + { + rOutAttrs.Put( SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) ); + } + + BOOL bStacked = aWOAngle.IsStackedTxt(); + if( bStacked != m_bInitialStacking ) + { + if( aWOAngle.IsStackedTxt() ) + { +// eOrient = CHTXTORIENT_STACKED; + bIsStacked = TRUE; +// rOutAttrs.Put( SfxInt32Item( SCHATTR_TEXT_DEGREES, 0 ) ); + } + } + +// if( eOrient != CHTXTORIENT_STACKED ) +// { +// if( nDegrees == 0L ) +// eOrient = CHTXTORIENT_STANDARD; +// else if( nDegrees <= 18000L ) +// eOrient = CHTXTORIENT_BOTTOMTOP; +// else +// eOrient = CHTXTORIENT_TOPBOTTOM; +// } + +// rOutAttrs.Put( SvxChartTextOrientItem( eOrient ) ); + rOutAttrs.Put( SfxBoolItem( SCHATTR_TEXT_STACKED, bIsStacked ) ); + + if( bShowStaggeringControls ) + { + SvxChartTextOrder eOrder; + bool bRadioButtonChecked = true; + + if( aRbUpDown.IsChecked()) + eOrder = CHTXTORDER_UPDOWN; + else if( aRbDownUp.IsChecked()) + eOrder = CHTXTORDER_DOWNUP; + else if( aRbAuto.IsChecked()) + eOrder = CHTXTORDER_AUTO; + else if( aRbSideBySide.IsChecked()) + eOrder = CHTXTORDER_SIDEBYSIDE; + else + bRadioButtonChecked = false; + + if( bRadioButtonChecked ) + rOutAttrs.Put( SvxChartTextOrderItem( eOrder )); + } + + if( aCbTextOverlap.GetState() != STATE_DONTKNOW ) + rOutAttrs.Put( SfxBoolItem( SCHATTR_TEXT_OVERLAP, aCbTextOverlap.IsChecked() ) ); + if( aCbTextBreak.GetState() != STATE_DONTKNOW ) +// rOutAttrs.Put( SfxBoolItem( SID_TEXTBREAK, aCbTextBreak.IsChecked() ) ); + rOutAttrs.Put( SfxBoolItem( SCHATTR_TEXTBREAK, aCbTextBreak.IsChecked() ) ); + if( aCbShowDescription.GetState() != STATE_DONTKNOW ) + rOutAttrs.Put( SfxBoolItem( SCHATTR_AXIS_SHOWDESCR, aCbShowDescription.IsChecked() ) ); + + return TRUE; +} + +void SchAxisLabelTabPage::Reset( const SfxItemSet& rInAttrs ) +{ + const SfxPoolItem* pPoolItem = NULL; + SfxItemState aState = SFX_ITEM_UNKNOWN; + + // show description ---------- + aState = rInAttrs.GetItemState( SCHATTR_AXIS_SHOWDESCR, FALSE, &pPoolItem ); + if( aState == SFX_ITEM_DONTCARE ) + { + aCbShowDescription.EnableTriState( TRUE ); + aCbShowDescription.SetState( STATE_DONTKNOW ); + } + else + { + aCbShowDescription.EnableTriState( FALSE ); + BOOL bCheck = FALSE; + if( aState == SFX_ITEM_SET ) + bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue(); + aCbShowDescription.Check( bCheck ); + + if( ( aState & SFX_ITEM_DEFAULT ) == 0 ) + aCbShowDescription.Hide(); + } + + // Rotation as orient item or in degrees ---------- + BOOL bStacked = FALSE; + short nDegrees = 0; + + // check new degree item + aState = rInAttrs.GetItemState( SCHATTR_TEXT_DEGREES, FALSE, &pPoolItem ); + if( aState == SFX_ITEM_DONTCARE ) + { + // tristate for SvxWinOrientation missing + nDegrees = 0; + } + else if( aState == SFX_ITEM_SET ) + { + nDegrees = static_cast< short >( static_cast< const SfxInt32Item * >( pPoolItem )->GetValue() / 100L ); + } + + // check old orientation item +// if( rInAttrs.GetItemState( SCHATTR_TEXT_ORIENT, TRUE, &pPoolItem ) == SFX_ITEM_SET ) +// { +// SvxChartTextOrient eOrient = static_cast< const SvxChartTextOrientItem * >( pPoolItem )->GetValue(); +// switch( eOrient ) +// { +// case CHTXTORIENT_AUTOMATIC: +// case CHTXTORIENT_STANDARD: +// break; +// case CHTXTORIENT_TOPBOTTOM: +// if( !nDegrees ) +// nDegrees = 270; +// break; +// case CHTXTORIENT_BOTTOMTOP: +// if( !nDegrees ) +// nDegrees = 90; +// break; +// case CHTXTORIENT_STACKED: +// bStacked = TRUE; +// break; +// } +// } + + if( rInAttrs.GetItemState( SCHATTR_TEXT_STACKED, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + { + bStacked = reinterpret_cast< const SfxBoolItem * >( pPoolItem )->GetValue(); + } + + aWOAngle.SetDegrees( nDegrees ); + aWOAngle.SetStackedTxt( bStacked ); + m_nInitialDegrees = nDegrees; + m_bInitialStacking = bStacked; + + // Text overlap ---------- + aState = rInAttrs.GetItemState( SCHATTR_TEXT_OVERLAP, FALSE, &pPoolItem ); + if( aState == SFX_ITEM_DONTCARE ) + { + aCbTextOverlap.EnableTriState( TRUE ); + aCbTextOverlap.SetState( STATE_DONTKNOW ); + } + else + { + aCbTextOverlap.EnableTriState( FALSE ); + BOOL bCheck = FALSE; + if( aState == SFX_ITEM_SET ) + bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue(); + aCbTextOverlap.Check( bCheck ); + + if( ( aState & SFX_ITEM_DEFAULT ) == 0 ) + aCbTextOverlap.Hide(); + } + + // text break ---------- +// aState = rInAttrs.GetItemState( SID_TEXTBREAK, FALSE, &pPoolItem ); + aState = rInAttrs.GetItemState( SCHATTR_TEXTBREAK, FALSE, &pPoolItem ); + if( aState == SFX_ITEM_DONTCARE ) + { + aCbTextBreak.EnableTriState( TRUE ); + aCbTextBreak.SetState( STATE_DONTKNOW ); + } + else + { + aCbTextBreak.EnableTriState( FALSE ); + BOOL bCheck = FALSE; + if( aState == SFX_ITEM_SET ) + bCheck = static_cast< const SfxBoolItem * >( pPoolItem )->GetValue(); + aCbTextBreak.Check( bCheck ); + + if( ( aState & SFX_ITEM_DEFAULT ) == 0 ) + { + aCbTextBreak.Hide(); + if( ! aCbTextOverlap.IsVisible() ) + aFlTextFlow.Hide(); + } + } + + // text order ---------- + if( bShowStaggeringControls ) + { + aState = rInAttrs.GetItemState( SCHATTR_TEXT_ORDER, FALSE, &pPoolItem ); + if( aState == SFX_ITEM_SET ) + { + SvxChartTextOrder eOrder = static_cast< const SvxChartTextOrderItem * >( pPoolItem )->GetValue(); + + switch( eOrder ) + { + case CHTXTORDER_SIDEBYSIDE: + aRbSideBySide.Check(); + break; + case CHTXTORDER_UPDOWN: + aRbUpDown.Check(); + break; + case CHTXTORDER_DOWNUP: + aRbDownUp.Check(); + break; + case CHTXTORDER_AUTO: + aRbAuto.Check(); + break; + } + } + } + + ToggleShowLabel( (void*)0 ); +} + +void SchAxisLabelTabPage::ShowStaggeringControls( BOOL ShowStaggeringControls ) +{ + bShowStaggeringControls = ShowStaggeringControls; + + if( !bShowStaggeringControls ) + { + aRbSideBySide.Hide(); + aRbUpDown.Hide(); + aRbDownUp.Hide(); + aRbAuto.Hide(); + aFlOrder.Hide(); + } +} + +// event handling routines +// ----------------------- + +IMPL_LINK ( SchAxisLabelTabPage, ToggleShowLabel, void *, EMPTYARG ) +{ + BOOL bEnable = ( aCbShowDescription.GetState() != STATE_NOCHECK ); + + if( bEnable ) + aWOAngle.Enable(); + else + aWOAngle.Disable(); + + aFlOrder.Enable( bEnable ); + aRbSideBySide.Enable( bEnable ); + aRbUpDown.Enable( bEnable ); + aRbDownUp.Enable( bEnable ); + aRbAuto.Enable( bEnable ); + + aFlTextFlow.Enable( bEnable ); + aCbTextOverlap.Enable( bEnable ); + aCbTextBreak.Enable( bEnable ); + + return 0L; +} +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.hxx b/chart2/source/controller/dialogs/tp_AxisLabel.hxx new file mode 100644 index 000000000000..49a6743b48bc --- /dev/null +++ b/chart2/source/controller/dialogs/tp_AxisLabel.hxx @@ -0,0 +1,132 @@ +/************************************************************************* + * + * $RCSfile: tp_AxisLabel.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_TP_AXISLABEL_HXX +#define _CHART2_TP_AXISLABEL_HXX + +#ifndef _SFXTABDLG_HXX +#include <sfx2/tabdlg.hxx> +#endif +// header for CheckBox +#ifndef _SV_BUTTON_HXX +#include <vcl/button.hxx> +#endif +// header for SvxWinOrientation +#ifndef WORIENT_HXX +#include <svx/worient.hxx> +#endif + +//#include "attrib.hxx" + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +class SchAxisLabelTabPage : public SfxTabPage +{ +private: + CheckBox aCbShowDescription; + + SvxWinOrientation aWOAngle; + + FixedLine aFlTextFlow; + CheckBox aCbTextOverlap; + CheckBox aCbTextBreak; + + FixedLine aFlOrder; + RadioButton aRbSideBySide; + RadioButton aRbUpDown; + RadioButton aRbDownUp; + RadioButton aRbAuto; + + FixedLine aFlSeparator; + + BOOL bShowStaggeringControls; +//// BOOL bAllowTextOverlap; + + short m_nInitialDegrees; + BOOL m_bInitialStacking; + + DECL_LINK ( ToggleShowLabel, void* ); + +public: + SchAxisLabelTabPage( Window* pParent, const SfxItemSet& rInAttrs ); + virtual ~SchAxisLabelTabPage(); + + void Construct(); + + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rInAttrs ); + virtual BOOL FillItemSet( SfxItemSet& rOutAttrs ); + virtual void Reset( const SfxItemSet& rInAttrs ); + + void ShowStaggeringControls( BOOL ShowStaggeringControls ); +//// void AllowTextOverlap( BOOL bOverLap ) { bAllowTextOverlap = bOverLap; } +}; +//............................................................................. +} //namespace chart +//............................................................................. + +#endif + diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.src b/chart2/source/controller/dialogs/tp_AxisLabel.src new file mode 100644 index 000000000000..82bb5f3cb1dd --- /dev/null +++ b/chart2/source/controller/dialogs/tp_AxisLabel.src @@ -0,0 +1,589 @@ +/************************************************************************* + * + * $RCSfile: tp_AxisLabel.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "HelpIds.hrc" +#include "TabPages.hrc" + +#define MASKCOLOR MaskColor = Color { Red = 0xC000 ; Green = 0xC000 ; Blue = 0xC000 ; } + +TabPage TP_AXIS_LABEL +{ + HelpID = HID_SCH_TP_AXIS_LABEL; + Size = MAP_APPFONT ( 260 , 185 ) ; + Hide = TRUE; + + Text = "Beschriftung" ; + Text [ ENGLISH ] = "Labelling" ; + Text [ english_us ] = "Label" ; + + CheckBox CB_AXIS_LABEL_SCHOW_DESCR + { + Pos = MAP_APPFONT ( 6 , 6 ) ; + Size = MAP_APPFONT ( 104 , 12 ) ; + + Text = "~Beschriftung anzeigen"; + Text [ ENGLISH ] = "s~how labels"; + Text [ english_us ] = "Sho~w labels"; + Text[ portuguese ] = "Mostrar ~rtulos"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "O~pschriften weergeven"; + Text[ french ] = "Afficher l'~tiquette"; + Text[ spanish ] = "Mostrar ~etiqueta"; + Text[ italian ] = "Mostra dicitura"; + Text[ danish ] = "Vis etiketter"; + Text[ swedish ] = "Visa etikett"; + Text[ polish ] = "Pok~a etykiety"; + Text[ portuguese_brazilian ] = "Mostrar ~rtulos"; + Text[ japanese ] = "ラベルの表示(~W)"; + Text[ korean ] = "레이블 표시(~W)"; + Text[ chinese_simplified ] = "显示数据标志(~W)"; + Text[ chinese_traditional ] = "顯示標籤(~W)"; + Text[ arabic ] = " "; + Text[ turkish ] = "~Etiketleri grntle"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Mos~tra les etiquetes"; + Text[ finnish ] = "Nyt ~selitteet"; + Text[ thai ] = "แสด~งป้ายชื่อ"; + Text[ czech ] = "Zobrazit popisky"; + Text[ hebrew ] = "~Beschriftung anzeigen"; + Text[ hindi ] = "लेबिलों को दिखा~ओ "; + Text[ slovak ] = "~Zobraziť popisy"; + }; + + FixedLine FL_AXIS_LABEL_ORIENTATION + { + Pos = MAP_APPFONT ( 6 , 91 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + + Text = "Beschriftung drehen" ; + Text [ ENGLISH ] = "Orientation" ; + Text [ norwegian ] = "Orientation" ; + Text [ italian ] = "Orientamento" ; + Text [ portuguese_brazilian ] = "Girar texto" ; + Text [ portuguese ] = "Rodar texto" ; + Text [ finnish ] = "Kierr teksti" ; + Text [ danish ] = "Roter etiket" ; + Text [ french ] = "Orientation" ; + Text [ swedish ] = "Rotera etikett" ; + Text [ dutch ] = "Opschrift draaien" ; + Text [ spanish ] = "Girar etiqueta" ; + Text [ english_us ] = "Rotate text" ; + Text[ chinese_simplified ] = "书写方向"; + Text[ russian ] = " "; + Text[ polish ] = "Obr tekst"; + Text[ japanese ] = "文字方向"; + Text[ chinese_traditional ] = "書寫方向"; + Text[ arabic ] = " "; + Text[ dutch ] = "Opschrift draaien"; + Text[ chinese_simplified ] = "书写方向"; + Text[ greek ] = " "; + Text[ korean ] = "텍스트 회전"; + Text[ turkish ] = "Metni evir"; + Text[ catalan ] = "Direcci d'escriptura"; + Text[ thai ] = "ทิศทางข้อความ"; + Text[ czech ] = "Otočit text"; + Text[ hebrew ] = "Beschriftung drehen"; + Text[ hindi ] = "टैक्स्ट् घुमाओ"; + Text[ slovak ] = "Otočiť text"; + }; + Control CT_AXIS_LABEL_DIAL + { + HelpId = HID_SCH_ALIGNMENT_CTR_DIAL ; + Pos = MAP_APPFONT ( 30 , 105 ) ; + Size = MAP_APPFONT ( 42 , 43 ) ; + Text = "ABCD" ; + }; + ImageButton PB_AXIS_LABEL_TEXTSTACKED + { + HelpId = HID_SCH_ALIGNMENT_STACKED ; + Pos = MAP_APPFONT ( 12 , 105 ) ; + Size = MAP_APPFONT ( 12 , 43 ) ; + TabStop = TRUE ; + ButtonImage = Image + { + ImageBitmap = Bitmap { File = "txtstk.bmp" ; }; + MaskColor = Color { Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; } ; +// MASKCOLOR ; + }; + }; + FixedText FT_AXIS_LABEL_DEGREES + { + Pos = MAP_APPFONT ( 110 , 122 ) ; + Size = MAP_APPFONT ( 35 , 8 ) ; + + Text = "~Grad" ; + Text [ ENGLISH ] = "~Degrees" ; + Text [ english_us ] = "~Degrees" ; + Text [ portuguese_brazilian ] = "Gr~aus" ; + Text [ swedish ] = "grader" ; + Text [ danish ] = "grader" ; + Text [ italian ] = "~Grado" ; + Text [ spanish ] = "~Grado" ; + Text [ french ] = "Degr~s" ; + Text [ dutch ] = "~Graden" ; + Text [ portuguese ] = "Gr~aus" ; + Text[ chinese_simplified ] = "度(~D)"; + Text[ russian ] = ""; + Text[ polish ] = "~Stopnie"; + Text[ japanese ] = "度(~D)"; + Text[ chinese_traditional ] = "度(~D)"; + Text[ arabic ] = ""; + Text[ dutch ] = "~Graden"; + Text[ chinese_simplified ] = "度(~D)"; + Text[ greek ] = ""; + Text[ korean ] = "도(~D)"; + Text[ turkish ] = "~Derece"; + Text[ catalan ] = "~Graus"; + Text[ finnish ] = "~Asteet"; + Text[ thai ] = "~องศา"; + Text[ czech ] = "stupňů"; + Text[ hebrew ] = "~Grad"; + Text[ hindi ] = "~Degrees"; + Text[ slovak ] = "Stup~ne"; + }; + NumericField NF_AXIS_LABEL_ORIENT + { + HelpId = HID_SCH_ALIGNMENT_DEGREES ; + Border = TRUE ; + Pos = MAP_APPFONT ( 78 , 120 ) ; + Size = MAP_APPFONT ( 28 , 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + StrictFormat = TRUE ; + }; + FixedText FT_UNUSED + { + //only necessary for constructor of SvxWinOrientation + Hide = TRUE ; + Pos = MAP_APPFONT ( 204 , 117 ) ; + Size = MAP_APPFONT ( 50 , 10 ) ; + Text = "unbenutzt" ; + // This text is never displayed and does therefore not have to be translated! + }; + Control CT_UNUSED + { + //only necessary for constructor of SvxWinOrientation + Hide = TRUE ; + Pos = MAP_APPFONT ( 204 , 133 ) ; + Size = MAP_APPFONT ( 50 , 15 ) ; + //TabStop = TRUE ; + }; + FixedLine FL_SEPARATOR + { + Pos = MAP_APPFONT ( 128 , 33 ) ; + Size = MAP_APPFONT ( 4 , 52 ) ; + }; + + FixedLine FL_AXIS_LABEL_TEXTFLOW + { + Pos = MAP_APPFONT ( 133 , 22 ) ; + Size = MAP_APPFONT ( 121 , 8 ) ; + + Text = "Textfluss" ; + Text [ ENGLISH ] = "Textflow" ; + Text [ english_us ] = "Text flow" ; + Text[ portuguese ] = "Fluxo de texto"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "Tekstverloop"; + Text[ french ] = "Enchanements"; + Text[ spanish ] = "Flujo del texto"; + Text[ italian ] = "Testo"; + Text[ danish ] = "Tekstretning"; + Text[ swedish ] = "Textflde"; + Text[ polish ] = "Przepyw tekstu"; + Text[ portuguese_brazilian ] = "Fluxo do texto"; + Text[ japanese ] = "体裁"; + Text[ korean ] = "텍스트 흐름"; + Text[ chinese_simplified ] = "换行和分页"; + Text[ chinese_traditional ] = "換行和分頁"; + Text[ arabic ] = " "; + Text[ turkish ] = "Metin ak"; + Text[ catalan ] = "Flux de text"; + Text[ finnish ] = "Tekstin rivitys"; + Text[ thai ] = "การไหลของข้อความ"; + Text[ czech ] = "Tok textu"; + Text[ hebrew ] = "Textfluss"; + Text[ hindi ] = "टेक्स्ट् धारा"; + Text[ slovak ] = "Tok textu"; + }; + CheckBox CB_AXIS_LABEL_TEXTOVERLAP + { + Pos = MAP_APPFONT ( 139 , 33 ) ; + Size = MAP_APPFONT ( 76 , 10 ) ; + TabStop = TRUE ; + + Text = "~berlappend" ; + Text [ ENGLISH ] = "~Overlap" ; + Text [ english_us ] = "O~verlap" ; + Text [ portuguese_brazilian ] = "Sobr~epor" ; + Text [ swedish ] = "verlappande" ; + Text [ danish ] = "Overlappet" ; + Text [ italian ] = "Sovrapponi" ; + Text [ spanish ] = "So~breponer" ; + Text [ french ] = "~Chevauchement" ; + Text [ dutch ] = "~Overlappend" ; + Text [ portuguese ] = "Em ~cascata" ; + Text [ chinese_simplified ] = "重叠(~V)"; + Text [ russian ] = ""; + Text [ polish ] = "Nakadanie"; + Text [ japanese ] = "重ね合わせ(~V)"; + Text [ chinese_traditional ] = "重疊(~V)"; + Text [ arabic ] = ""; + Text [ dutch ] = "~Overlappend"; + Text [ chinese_simplified ] = "重叠(~V)"; + Text[ greek ] = ""; + Text[ korean ] = "겹침(~V)"; + Text[ turkish ] = "B~asamakla"; + Text[ catalan ] = "~Superposa"; + Text[ finnish ] = "~Pllekkisyys"; + Text[ thai ] = "ซ้~อนทับ"; + Text[ czech ] = "Přesah"; + Text[ hebrew ] = "~Überlappend"; + Text[ hindi ] = "ऑ~वरलाप्"; + Text[ slovak ] = "P~resah"; + }; + CheckBox CB_AXIS_LABEL_TEXTBREAK + { + Pos = MAP_APPFONT ( 139 , 47 ) ; + Size = MAP_APPFONT ( 76 , 10 ) ; + TabStop = TRUE ; + + Text = "~Umbruch" ; + Text [ ENGLISH ] = "~Break" ; + Text [ english_us ] = "~Break" ; + Text [ portuguese_brazilian ] = "~Quebrar" ; + Text [ swedish ] = "Brytning" ; + Text [ danish ] = "Skift" ; + Text [ italian ] = "A capo" ; + Text [ spanish ] = "~Salto" ; + Text [ french ] = "~Saut" ; + Text [ dutch ] = "~Afbreking" ; + Text [ portuguese ] = "~Quebra" ; + Text [ chinese_simplified ] = "换行(~B)"; + Text [ russian ] = "~"; + Text [ polish ] = "~Podzia"; + Text [ japanese ] = "折り返し(~B)"; + Text [ chinese_traditional ] = "換行(~B)"; + Text [ arabic ] = ""; + Text [ dutch ] = "~Afbreking"; + Text [ chinese_simplified ] = "换行(~B)"; + Text[ greek ] = ""; + Text[ korean ] = "나누기(~B)"; + Text[ turkish ] = "~Kesme"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Salta"; + Text[ finnish ] = "~Vaihto"; + Text[ thai ] = "แ~บ่ง"; + Text[ czech ] = "Zalomení"; + Text[ hebrew ] = "~Umbruch"; + Text[ hindi ] = "~खण्डन"; + Text[ slovak ] = "~Zalomenie"; + }; + + + FixedLine FL_AXIS_LABEL_ORDER + { + Pos = MAP_APPFONT ( 6 , 22 ) ; + Size = MAP_APPFONT ( 121 , 8 ) ; + + Text = "Anordnung" ; + Text [ ENGLISH ] = "Order" ; + Text [ norwegian ] = "Rekkeflge" ; + Text [ italian ] = "Disponi" ; + Text [ portuguese_brazilian ] = "Ordem" ; + Text [ portuguese ] = "Disposio" ; + Text [ english_us ] = "Order" ; + Text [ spanish ] = "Organizar" ; + Text [ french ] = "Disposition" ; + Text [ dutch ] = "Positie" ; + Text [ swedish ] = "Placering" ; + Text [ danish ] = "Placering" ; + Text[ chinese_simplified ] = "排序"; + Text[ russian ] = ""; + Text[ polish ] = "Kolejno"; + Text[ japanese ] = "配置"; + Text[ chinese_traditional ] = "排序"; + Text[ arabic ] = ""; + Text[ dutch ] = "Positie"; + Text[ chinese_simplified ] = "排序"; + Text[ greek ] = ""; + Text[ korean ] = "배열 순서"; + Text[ turkish ] = "Dzenle"; + Text[ catalan ] = "Organitzar"; + Text[ finnish ] = "Jrjestys"; + Text[ thai ] = "ลำดับ"; + Text[ czech ] = "Pořadí"; + Text[ hebrew ] = "Anordnung"; + Text[ hindi ] = "क्रम"; + Text[ slovak ] = "Poradie"; + }; + RadioButton RB_AXIS_LABEL_SIDEBYSIDE + { + Pos = MAP_APPFONT ( 12 , 33 ) ; + Size = MAP_APPFONT ( 98 , 10 ) ; + TabStop = TRUE ; + + Text = "~Nebeneinander" ; + Text [ ENGLISH ] = "~Side by Side" ; + Text [ norwegian ] = "~Side by Side" ; + Text [ italian ] = "Affianca" ; + Text [ portuguese_brazilian ] = "~Lado a Lado" ; + Text [ portuguese ] = "~Lado a lado" ; + Text [ english_us ] = "~Tile" ; + Text [ spanish ] = "~Mosaico" ; + Text [ french ] = "~Juxtaposer" ; + Text [ dutch ] = "~Naast elkaar" ; + Text [ swedish ] = "Bredvid vara~ndra" ; + Text [ danish ] = "Side om side" ; + Text[ chinese_simplified ] = "并排(~T)"; + Text[ russian ] = ""; + Text[ polish ] = "~Ssiadujco"; + Text[ japanese ] = "1列に並べる(~T)"; + Text[ chinese_traditional ] = "並排(~T)"; + Text[ arabic ] = ""; + Text[ dutch ] = "~Naast elkaar"; + Text[ chinese_simplified ] = "并排(~T)"; + Text[ greek ] = " "; + Text[ korean ] = "바둑판식 배치(~T)"; + Text[ turkish ] = "~De"; + Text[ catalan ] = "~Mosaic"; + Text[ finnish ] = "~Vierekkin"; + Text[ thai ] = "แ~บบกระเบื้อง"; + Text[ czech ] = "Dlaždice"; + Text[ hebrew ] = "~Nebeneinander"; + Text[ hindi ] = "~पटिया"; + Text[ slovak ] = "~Dlaždice"; + }; + RadioButton RB_AXIS_LABEL_UPDOWN + { + Pos = MAP_APPFONT ( 12 , 47 ) ; + Size = MAP_APPFONT ( 98 , 10 ) ; + TabStop = TRUE ; + + Text = "~Hoch-tief versetzt" ; + Text [ ENGLISH ] = "~Up-down transposed" ; + Text [ norwegian ] = "~Up-down transposed" ; + Text [ italian ] = "Sposta pari/dispari" ; + Text [ portuguese_brazilian ] = "~mpares em cima" ; + Text [ portuguese ] = "~mpares em cima" ; + Text [ english_us ] = "St~agger odd" ; + Text [ spanish ] = "~Organizacin impar" ; + Text [ french ] = "Transposer ~haut-bas" ; + Text [ dutch ] = "Laag-h~oog verzet" ; + Text [ swedish ] = "Upphjt/nedsnkt" ; + Text [ danish ] = "Ulige tal forskudt" ; + Text[ chinese_simplified ] = "上下移动(~A)"; + Text[ russian ] = " ( ~)"; + Text[ polish ] = "Roz~m. przest. (gra-d)"; + Text[ japanese ] = "上下交互(~A)"; + Text[ chinese_traditional ] = "上下移動(~A)"; + Text[ arabic ] = " "; + Text[ dutch ] = "Laag-h~oog verzet"; + Text[ chinese_simplified ] = "上下移动(~A)"; + Text[ greek ] = "~ -"; + Text[ korean ] = "위 아래 엇갈림(~A)"; + Text[ turkish ] = "Yukar/aa hizalama"; + Text[ catalan ] = "Esc~alonament senar"; + Text[ finnish ] = "Lo~mita parittomat"; + Text[ thai ] = "สลั~บเลขคี่"; + Text[ czech ] = "Předsunout liché"; + Text[ hebrew ] = "~Hoch-tief versetzt"; + Text[ hindi ] = "स्टा~ग्गेर् ऑड़"; + Text[ slovak ] = "~Posunúť nepárne"; + }; + RadioButton RB_AXIS_LABEL_DOWNUP + { + Pos = MAP_APPFONT ( 12 , 61 ) ; + Size = MAP_APPFONT ( 98 , 10 ) ; + TabStop = TRUE ; + + Text = "~Tief-hoch versetzt" ; + Text [ ENGLISH ] = "~Down-up transposed" ; + Text [ norwegian ] = "~Down-up transposed" ; + Text [ italian ] = "Sposta dispari/pari" ; + Text [ portuguese_brazilian ] = "~Pares em cima" ; + Text [ portuguese ] = "~Pares em cima" ; + Text [ english_us ] = "Stagger ~even" ; + Text [ dutch ] = "~Hoog-laag verzet" ; + Text [ spanish ] = "Orga~nizacin par" ; + Text [ french ] = "Transposer ~bas-haut" ; + Text [ swedish ] = "Nedsnkt/upphjt" ; + Text [ danish ] = "Lige tal forskudt" ; + Text[ chinese_simplified ] = "下上移动(~E)"; + Text[ russian ] = " ( )"; + Text[ polish ] = "~Rozm. przest. (d-gra)"; + Text[ japanese ] = "下上交互(~E)"; + Text[ chinese_traditional ] = "下上移動(~E)"; + Text[ arabic ] = " "; + Text[ dutch ] = "~Hoog-laag verzet"; + Text[ chinese_simplified ] = "下上移动(~E)"; + Text[ greek ] = " ~-"; + Text[ korean ] = "아래 위 엇갈림(~E)"; + Text[ turkish ] = "Aa/yukar hizalama"; + Text[ catalan ] = "Escalonament ~parell "; + Text[ finnish ] = "Lomita ~parilliset"; + Text[ thai ] = "สลับเลข~คู่"; + Text[ czech ] = "Předsunout sudé"; + Text[ hebrew ] = "~Tief-hoch versetzt"; + Text[ hindi ] = "स्टाग्गेर् ~इवन"; + Text[ slovak ] = "Po~sunúť párne"; + }; + RadioButton RB_AXIS_LABEL_AUTOORDER + { + Pos = MAP_APPFONT ( 12 , 75 ) ; + Size = MAP_APPFONT ( 98 , 10 ) ; + TabStop = TRUE ; + + Text = "~Automatisch" ; + Text [ ENGLISH ] = "~Automatic" ; + Text [ norwegian ] = "~Automatisk" ; + Text [ italian ] = "Automatico" ; + Text [ portuguese_brazilian ] = "~Automtico" ; + Text [ portuguese ] = "~Automtico" ; + Text [ english_us ] = "A~utomatic" ; + Text [ spanish ] = "Automtico" ; + Text [ french ] = "Automatique" ; + Text [ dutch ] = "A~utomatisch" ; + Text [ swedish ] = "Automatiskt" ; + Text [ danish ] = "Automatisk" ; + Text[ chinese_simplified ] = "自动(~U)"; + Text[ russian ] = ""; + Text[ polish ] = "A~utomatycznie"; + Text[ japanese ] = "自動(~U)"; + Text[ chinese_traditional ] = "自動(~U)"; + Text[ arabic ] = ""; + Text[ dutch ] = "A~utomatisch"; + Text[ chinese_simplified ] = "自动(~U)"; + Text[ greek ] = "~"; + Text[ korean ] = "자동(~U)"; + Text[ turkish ] = "~Otomatik"; + Text[ catalan ] = "Automtic"; + Text[ finnish ] = "A~utomaattinen"; + Text[ thai ] = "อั~ตโนมัติ"; + Text[ czech ] = "Automaticky"; + Text[ hebrew ] = "אוטומטי"; + Text[ hindi ] = "A~utomatic"; + Text[ slovak ] = "A~utomaticky"; + }; + Text[ portuguese ] = "Legenda"; + Text[ russian ] = ""; + Text[ greek ] = ""; + Text[ dutch ] = "Opschrift"; + Text[ french ] = "tiquette"; + Text[ spanish ] = "Etiqueta"; + Text[ italian ] = "Dicitura"; + Text[ danish ] = "Etiket"; + Text[ swedish ] = "Etikett"; + Text[ polish ] = "Etykieta"; + Text[ portuguese_brazilian ] = "Rtulo"; + Text[ japanese ] = "ラベル"; + Text[ korean ] = "레이블"; + Text[ chinese_simplified ] = "数据标志"; + Text[ chinese_traditional ] = "標籤"; + Text[ arabic ] = ""; + Text[ turkish ] = "Etiket"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Etiqueta"; + Text[ finnish ] = "Selite"; + Text[ thai ] = "ป้ายชื่อ"; + Text[ czech ] = "Popisek"; + Text[ hebrew ] = "Beschriftung"; + Text[ hindi ] = "लेबिल"; + Text[ slovak ] = "Označenie"; +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/source/controller/dialogs/tp_DataLabel.cxx b/chart2/source/controller/dialogs/tp_DataLabel.cxx new file mode 100644 index 000000000000..3d06c3d9688b --- /dev/null +++ b/chart2/source/controller/dialogs/tp_DataLabel.cxx @@ -0,0 +1,229 @@ +/************************************************************************* + * + * $RCSfile: tp_DataLabel.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "tp_DataLabel.hxx" +#include "TabPages.hrc" +#include "ResId.hxx" +#include "SchSfxItemIds.hxx" + +#ifndef _SFXENUMITEM_HXX +#include <svtools/eitem.hxx> +#endif +#define ITEMID_CHARTDATADESCR SCHATTR_DATADESCR_DESCR +#ifndef _SVX_CHRTITEM_HXX +#include <svx/chrtitem.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +SchDataDescrTabPage::SchDataDescrTabPage(Window* pWindow, + const SfxItemSet& rInAttrs) : + SfxTabPage(pWindow, SchResId(TP_DATA_DESCR), rInAttrs), + aCbValue(this, ResId(CB_VALUE)), + aRbNumber(this, ResId(RB_NUMBER)), + aRbPercent(this, ResId(RB_PERCENT)), + aCbText(this, ResId(CB_TEXT)), + aCbSymbol(this, ResId(CB_SYMBOL)), + rOutAttrs(rInAttrs) +{ + FreeResource(); + + aCbValue.SetClickHdl( LINK( this, SchDataDescrTabPage, EnableHdl )); + aCbText.SetClickHdl( LINK( this, SchDataDescrTabPage, EnableHdl )); +} + +/************************************************************************* +|* +|* Dtor +|* +\************************************************************************/ + +SchDataDescrTabPage::~SchDataDescrTabPage() +{ +} + +/************************************************************************* +|* +|* Handler fuer ShowSym-Button enablen/disablen +|* +\*************************************************************************/ + +IMPL_LINK( SchDataDescrTabPage, EnableHdl, CheckBox *, pControl ) +{ + aCbSymbol.Enable( aCbValue.IsChecked() || aCbText.IsChecked() ); + if( pControl == &aCbValue ) + { + aRbPercent.Enable( aCbValue.IsChecked() ); + aRbNumber.Enable( aCbValue.IsChecked() ); + } + + return 0; +} + +/************************************************************************* +|* +|* Erzeugung +|* +\*************************************************************************/ + +SfxTabPage* SchDataDescrTabPage::Create(Window* pWindow, + const SfxItemSet& rOutAttrs) +{ + return new SchDataDescrTabPage(pWindow, rOutAttrs); +} + +/************************************************************************* +|* +|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen +|* +\*************************************************************************/ + +BOOL SchDataDescrTabPage::FillItemSet(SfxItemSet& rOutAttrs) +{ + BOOL bText = aCbText.IsChecked(); + SvxChartDataDescr eDescr; + + if( aCbValue.IsChecked() ) + { + if( aRbNumber.IsChecked() ) + eDescr = (bText? CHDESCR_TEXTANDVALUE : CHDESCR_VALUE); + else + eDescr = (bText? CHDESCR_TEXTANDPERCENT : CHDESCR_PERCENT); + } + else if( aCbText.IsChecked() ) + eDescr = CHDESCR_TEXT; + else + eDescr = CHDESCR_NONE; + + rOutAttrs.Put(SvxChartDataDescrItem(eDescr)); + rOutAttrs.Put(SfxBoolItem( SCHATTR_DATADESCR_SHOW_SYM, + aCbSymbol.IsChecked()) ); + return TRUE; +} + +/************************************************************************* +|* +|* Initialisierung +|* +\*************************************************************************/ + +void SchDataDescrTabPage::Reset(const SfxItemSet& rInAttrs) +{ + const SfxPoolItem *pPoolItem = NULL; + + // default state + aRbNumber.Enable( FALSE ); + aRbPercent.Enable( FALSE ); + aCbSymbol.Enable( FALSE ); + + if( rOutAttrs.GetItemState(SCHATTR_DATADESCR_SHOW_SYM, + TRUE, &pPoolItem) == SFX_ITEM_SET ) + aCbSymbol.Check( ((const SfxBoolItem*)pPoolItem)->GetValue() ); + + if( rOutAttrs.GetItemState(SCHATTR_DATADESCR_DESCR, + TRUE, &pPoolItem) == SFX_ITEM_SET ) + { + switch( ((const SvxChartDataDescrItem*)pPoolItem)->GetValue() ) + { + case CHDESCR_VALUE: + aCbValue.Check(); + aRbNumber.Check(); + EnableHdl( &aCbValue ); + break; + + case CHDESCR_PERCENT: + aCbValue.Check(); + aRbPercent.Check(); + EnableHdl( &aCbValue ); + break; + + case CHDESCR_TEXT: + aCbText.Check(); + EnableHdl( &aCbText ); + break; + + case CHDESCR_TEXTANDPERCENT: + aCbText.Check(); + aCbValue.Check(); + aRbPercent.Check(); + EnableHdl( &aCbValue ); + break; + + case CHDESCR_TEXTANDVALUE: + aCbText.Check(); + aCbValue.Check(); + aRbNumber.Check(); + EnableHdl( &aCbValue ); + break; + + default: + break; + } + } + if( !aRbNumber.IsChecked() && !aRbPercent.IsChecked() ) + aRbNumber.Check(); +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/dialogs/tp_DataLabel.hxx b/chart2/source/controller/dialogs/tp_DataLabel.hxx new file mode 100644 index 000000000000..ad8f2d2d6187 --- /dev/null +++ b/chart2/source/controller/dialogs/tp_DataLabel.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * $RCSfile: tp_DataLabel.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_TP_DATALABEL_HXX +#define _CHART2_TP_DATALABEL_HXX + +#ifndef _SFXTABDLG_HXX +#include <sfx2/tabdlg.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +class SchDataDescrTabPage : public SfxTabPage +{ +private: + CheckBox aCbValue; + RadioButton aRbNumber; + RadioButton aRbPercent; + CheckBox aCbText; + CheckBox aCbSymbol; + + const SfxItemSet& rOutAttrs; + + DECL_LINK(EnableHdl, CheckBox * ); + +public: + SchDataDescrTabPage(Window* pParent, const SfxItemSet& rInAttrs); + virtual ~SchDataDescrTabPage(); + + static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs); + virtual BOOL FillItemSet(SfxItemSet& rOutAttrs); + virtual void Reset(const SfxItemSet& rInAttrs); +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/controller/dialogs/tp_DataLabel.src b/chart2/source/controller/dialogs/tp_DataLabel.src new file mode 100644 index 000000000000..ebe92daff2f7 --- /dev/null +++ b/chart2/source/controller/dialogs/tp_DataLabel.src @@ -0,0 +1,76 @@ +/************************************************************************* + * + * $RCSfile: tp_DataLabel.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "HelpIds.hrc" +#include "TabPages.hrc" +#include "res_DataLabel.hrc" + +#ifndef _GLOBLMN_HRC +#include <svx/globlmn.hrc> +#endif + +TabPage TP_DATA_DESCR +{ + Hide = TRUE ; + HelpID = HID_SCH_DATA_DESCR ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 260 , 185 ) ; + RESOURCE_DATALABEL( 6, 6 ) +}; diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.cxx b/chart2/source/controller/dialogs/tp_LegendPosition.cxx new file mode 100644 index 000000000000..f46217889540 --- /dev/null +++ b/chart2/source/controller/dialogs/tp_LegendPosition.cxx @@ -0,0 +1,187 @@ +/************************************************************************* + * + * $RCSfile: tp_LegendPosition.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "tp_LegendPosition.hxx" + +#include "ResId.hxx" +#include "TabPages.hrc" +#include "SchSfxItemIds.hxx" + +//#include "schattr.hxx" +#define ITEMID_CHARTLEGENDPOS SCHATTR_LEGEND_POS +#ifndef _SVX_CHRTITEM_HXX //autogen +#include <svx/chrtitem.hxx> +#endif +/* +#include "schresid.hxx" +#include "chtmodel.hxx" +#include "attrib.hxx" +#include "attrib.hrc" +*/ +//............................................................................. +namespace chart +{ +//............................................................................. + +/************************************************************************* +|* +|* Dialog zur Ausrichtung der Legende +|* +\************************************************************************/ + +SchLegendPosTabPage::SchLegendPosTabPage(Window* pWindow, + const SfxItemSet& rInAttrs) : + SfxTabPage(pWindow, SchResId(TP_LEGEND_POS), rInAttrs), + aRbtLeft(this, ResId(RBT_LEFT)), + aRbtTop(this, ResId(RBT_TOP)), + aRbtRight(this, ResId(RBT_RIGHT)), + aRbtBottom(this, ResId(RBT_BOTTOM)), + aGrpLegend(this, ResId(GRP_LEGEND)), + rOutAttrs(rInAttrs) +{ + FreeResource(); +} + +/************************************************************************* +|* +|* Dtor +|* +/************************************************************************/ + +SchLegendPosTabPage::~SchLegendPosTabPage() +{ +} + +/************************************************************************* +|* +|* Erzeugung +|* +\*************************************************************************/ + +SfxTabPage* SchLegendPosTabPage::Create(Window* pWindow, + const SfxItemSet& rOutAttrs) +{ + return new SchLegendPosTabPage(pWindow, rOutAttrs); +} + +/************************************************************************* +|* +|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen +|* +\*************************************************************************/ + +BOOL SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs) +{ + SvxChartLegendPos ePos; + + if (aRbtLeft.IsChecked()) + ePos = CHLEGEND_LEFT; + else if (aRbtTop.IsChecked()) + ePos = CHLEGEND_TOP; + else if (aRbtRight.IsChecked()) + ePos = CHLEGEND_RIGHT; + else if (aRbtBottom.IsChecked()) + ePos = CHLEGEND_BOTTOM; + else + ePos = CHLEGEND_NONE; + + rOutAttrs.Put(SvxChartLegendPosItem(ePos)); + + return TRUE; +} + +/************************************************************************* +|* +|* Initialisierung +|* +\*************************************************************************/ + +void SchLegendPosTabPage::Reset(const SfxItemSet& rInAttrs) +{ + SvxChartLegendPos ePos = CHLEGEND_NONE; + + const SfxPoolItem* pPoolItem = NULL; + if( rInAttrs.GetItemState( SCHATTR_LEGEND_POS, + TRUE, &pPoolItem ) != SFX_ITEM_SET ) + pPoolItem = &(rInAttrs.GetPool()->GetDefaultItem( SCHATTR_LEGEND_POS )); + + if( pPoolItem ) + ePos = ((const SvxChartLegendPosItem*)pPoolItem)->GetValue(); + + switch( ePos ) + { + case CHLEGEND_LEFT: + aRbtLeft.Check(TRUE); + break; + case CHLEGEND_TOP: + aRbtTop.Check(TRUE); + break; + case CHLEGEND_RIGHT: + aRbtRight.Check(TRUE); + break; + case CHLEGEND_BOTTOM: + aRbtBottom.Check(TRUE); + break; + } +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.hxx b/chart2/source/controller/dialogs/tp_LegendPosition.hxx new file mode 100644 index 000000000000..a75c8c7790bf --- /dev/null +++ b/chart2/source/controller/dialogs/tp_LegendPosition.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * $RCSfile: tp_LegendPosition.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_TP_LEGENDPOSITION_HXX +#define _CHART2_TP_LEGENDPOSITION_HXX + +// header for SfxTabPage +#ifndef _SFXTABDLG_HXX +#include <sfx2/tabdlg.hxx> +#endif +// header for FixedText +#ifndef _SV_FIXED_HXX +#include <vcl/fixed.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +/************************************************************************* +|* +|* Legenden-Anordnungs-Tab-Page +|* +\************************************************************************/ +class SchLegendPosTabPage : public SfxTabPage +{ +private: + FixedLine aGrpLegend; + RadioButton aRbtLeft; + RadioButton aRbtTop; + RadioButton aRbtBottom; + RadioButton aRbtRight; + + const SfxItemSet& rOutAttrs; + +public: + SchLegendPosTabPage(Window* pParent, const SfxItemSet& rInAttrs); + virtual ~SchLegendPosTabPage(); + + static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs); + virtual BOOL FillItemSet(SfxItemSet& rOutAttrs); + virtual void Reset(const SfxItemSet& rInAttrs); +}; + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif + diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.src b/chart2/source/controller/dialogs/tp_LegendPosition.src new file mode 100644 index 000000000000..e9d066e059ed --- /dev/null +++ b/chart2/source/controller/dialogs/tp_LegendPosition.src @@ -0,0 +1,108 @@ +/************************************************************************* + * + * $RCSfile: tp_LegendPosition.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "HelpIds.hrc" +#include "TabPages.hrc" +#include "res_LegendPosition.hrc" + +TabPage TP_LEGEND_POS +{ + Hide = TRUE ; + HelpID = HID_SCH_LEGEND_POS ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 260 , 185 ) ; + FixedLine GRP_LEGEND + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text = "Anordnung" ; + Text [ ENGLISH ] = "Arrangement" ; + Text [ norwegian ] = "Arrangement" ; + Text [ italian ] = "Disponi" ; + Text [ portuguese_brazilian ] = "Posio" ; + Text [ portuguese ] = "Disposio" ; + Text [ finnish ] = "Sijainti" ; + Text [ danish ] = "Placering" ; + Text [ french ] = "Disposition" ; + Text [ swedish ] = "Placering" ; + Text [ dutch ] = "Positie" ; + Text [ spanish ] = "Posicin" ; + Text [ english_us ] = "Position" ; + Text[ chinese_simplified ] = "排序"; + Text[ russian ] = ""; + Text[ polish ] = "Pozycja"; + Text[ japanese ] = "配置"; + Text[ chinese_traditional ] = "排序"; + Text[ arabic ] = ""; + Text[ dutch ] = "Positie"; + Text[ chinese_simplified ] = "排序"; + Text[ greek ] = ""; + Text[ korean ] = "배열"; + Text[ turkish ] = "Konum"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Posici"; + Text[ thai ] = "ตำแหน่ง"; + Text[ czech ] = "Umístění"; + Text[ hebrew ] = "מיקום"; + Text[ hindi ] = "स्थान"; + Text[ slovak ] = "Umiestnenie"; + }; + RESOURCE_LEGENDPOSITION( 14 ) +}; diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.cxx b/chart2/source/controller/dialogs/tp_PointGeometry.cxx new file mode 100644 index 000000000000..3666d9e22e7a --- /dev/null +++ b/chart2/source/controller/dialogs/tp_PointGeometry.cxx @@ -0,0 +1,190 @@ +/************************************************************************* + * + * $RCSfile: tp_PointGeometry.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "tp_PointGeometry.hxx" + +#include "ResId.hxx" +#include "TabPages.hrc" +#include "SchSfxItemIds.hxx" + +// header for SfxInt32Item +#ifndef _SFXINTITEM_HXX +#include <svtools/intitem.hxx> +#endif +// header for class Svx3DHorizontalSegmentsItem +#ifndef _SVX3DITEMS_HXX +#include <svx/svx3ditems.hxx> +#endif +/* +#include "schattr.hxx" +#include "chmod3d.hxx" +#include "schresid.hxx" +#include "chtmodel.hxx" +#include "attrib.hxx" +#include "attrib.hrc" + +#ifndef _SVX_SVXIDS_HRC //autogen +#include <svx/svxids.hrc> +#endif +*/ + +//............................................................................. +namespace chart +{ +//............................................................................. + +SchLayoutTabPage::SchLayoutTabPage(Window* pWindow,const SfxItemSet& rInAttrs) : + SfxTabPage(pWindow, SchResId(TP_LAYOUT), rInAttrs), +/* aSquare(this, ResId(RBT_LY_CUBE)), + aCylinder(this, ResId(RBT_LY_CYLINDER)), + aCone(this, ResId(RBT_LY_CONE)), + aPyramid(this, ResId(RBT_LY_PYRAMID)), + aHanoi(this,ResId(RBT_LY_HANOI)), + */ + aListShapes(this,ResId(LB_LY_SHAPE)), + aFtLayout(this, ResId(FT_LY_SHAPE)), + rOutAttrs(rInAttrs) +{ + FreeResource(); +} +/************************************************************************* +|* +|* Dtor +|* +\************************************************************************/ + +SchLayoutTabPage::~SchLayoutTabPage() +{ +} + +/************************************************************************* +|* +|* Erzeugung +|* +\*************************************************************************/ + +SfxTabPage* SchLayoutTabPage::Create(Window* pWindow, + const SfxItemSet& rOutAttrs) +{ + return new SchLayoutTabPage(pWindow, rOutAttrs); +} + +/************************************************************************* +|* +|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen +|* +\*************************************************************************/ +BOOL SchLayoutTabPage::FillItemSet(SfxItemSet& rOutAttrs) +{ + + if(aListShapes.GetSelectEntryCount()) + { + long nShape=CHART_SHAPE3D_SQUARE; + long nSegs=32; + + nShape = aListShapes.GetSelectEntryPos(); + if(nShape==CHART_SHAPE3D_PYRAMID) + nSegs=4; + + rOutAttrs.Put(SfxInt32Item(SCHATTR_STYLE_SHAPE,nShape)); +//-/ rOutAttrs.Put(SfxUInt32Item(SID_ATTR_3D_HORZ_SEGS,nSegs)); + rOutAttrs.Put(Svx3DHorizontalSegmentsItem(nSegs)); + } + return TRUE; +} +/************************************************************************* +|* +|* Initialisierung +|* +\*************************************************************************/ + +void SchLayoutTabPage::Reset(const SfxItemSet& rInAttrs) +{ + const SfxPoolItem *pPoolItem = NULL; + + if (rInAttrs.GetItemState(SCHATTR_STYLE_SHAPE,TRUE, &pPoolItem) == SFX_ITEM_SET) + { + long nVal=((const SfxInt32Item*)pPoolItem)->GetValue(); + aListShapes.SelectEntryPos(nVal); + } +/* switch (nVal) + { + case CHART_SHAPE3D_SQUARE: + aSquare.Check(TRUE); + break; + case CHART_SHAPE3D_CYLINDER: + aCylinder.Check(TRUE); + break; + case CHART_SHAPE3D_CONE: + aCone.Check(TRUE); + break; + case CHART_SHAPE3D_PYRAMID: + aPyramid.Check(TRUE); + break; + case CHART_SHAPE3D_HANOI: + aHanoi.Check(TRUE); + break; + } +*/ +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.hxx b/chart2/source/controller/dialogs/tp_PointGeometry.hxx new file mode 100644 index 000000000000..ae824369db64 --- /dev/null +++ b/chart2/source/controller/dialogs/tp_PointGeometry.hxx @@ -0,0 +1,104 @@ +/************************************************************************* + * + * $RCSfile: tp_PointGeometry.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_TP_POINTGEOMETRY_HXX +#define _CHART2_TP_POINTGEOMETRY_HXX + +// header for SfxTabPage +#ifndef _SFXTABDLG_HXX +#include <sfx2/tabdlg.hxx> +#endif +// header for FixedText +#ifndef _SV_FIXED_HXX +#include <vcl/fixed.hxx> +#endif +// header for class ListBox +#ifndef _SV_LSTBOX_HXX +#include <vcl/lstbox.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +class SchLayoutTabPage : public SfxTabPage +{ +private: + FixedText aFtLayout; + ListBox aListShapes; + + const SfxItemSet& rOutAttrs; + +public: + SchLayoutTabPage(Window* pParent, const SfxItemSet& rInAttrs); + virtual ~SchLayoutTabPage(); + + static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs); + virtual BOOL FillItemSet(SfxItemSet& rOutAttrs); + virtual void Reset(const SfxItemSet& rInAttrs); +}; + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif + diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.src b/chart2/source/controller/dialogs/tp_PointGeometry.src new file mode 100644 index 000000000000..10bfed4419bf --- /dev/null +++ b/chart2/source/controller/dialogs/tp_PointGeometry.src @@ -0,0 +1,329 @@ +/************************************************************************* + * + * $RCSfile: tp_PointGeometry.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:26 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "HelpIds.hrc" +#include "TabPages.hrc" + +TabPage TP_LAYOUT +{ + Hide = TRUE ; +// HelpID = HID_LAYOUT ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 260 , 185 ) ; + FixedText FT_LY_SHAPE + { + Pos = MAP_APPFONT ( 6 , 6 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text = "Balken/Sulen Form" ; + Text [ ENGLISH ] = "Bar/Column Shape"; + Text[ italian ] = "Forma barre/colonne"; + Text[ portuguese_brazilian ] = "Forma da barra/coluna"; + Text[ portuguese ] = "Forma: barras/colunas"; + Text[ danish ] = "Liggende sjler/Sjler Form"; + Text[ french ] = "Barres/colonnes : forme"; + Text[ swedish ] = "Form p staplar"; + Text[ dutch ] = "Balken-/zuilenvorm"; + Text[ spanish ] = "Barras/columnas: forma"; + Text[ english_us ] = "Bar/column shape"; + Text[ chinese_simplified ] = "条块/圓柱形"; + Text[ russian ] = " ./. "; + Text[ polish ] = "Ksztat supka/kolumny"; + Text[ japanese ] = "形状"; + Text[ chinese_traditional ] = "條塊/圓柱體"; + Text[ arabic ] = ""; + Text[ dutch ] = "Balken-/zuilenvorm"; + Text[ chinese_simplified ] = "条块/圓柱形"; + Text[ greek ] = " /"; + Text[ korean ] = "형태"; + Text[ turkish ] = "Bar/Sutn ekli"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Forma"; + Text[ finnish ] = "Palkin/sarakkeen muoto"; + Text[ thai ] = "รูปร่าง"; + Text[ czech ] = "Profil sloupků/sloupců"; + Text[ hebrew ] = "Balken/Säulen Form"; + Text[ hindi ] = "पट्टी/स्तंभ आकार"; + Text[ slovak ] = "Tvar stĺpca/pásu"; + }; + ListBox LB_LY_SHAPE + { + Border = TRUE ; + AutoHScroll = TRUE ; + Pos = MAP_APPFONT ( 6 , 17 ) ; + Size = MAP_APPFONT ( 100 , 38 ) ; + TabStop = TRUE ; + Group = TRUE ; + DropDown=FALSE; + DDExtraWidth = TRUE ; + + StringList = + { + "Quader"; + "Zylinder"; + "Kegel"; + "Pyramiden"; + // "Turm von Hanoi"; + }; + StringList [ ENGLISH ] = + { + "Cube"; + "Cylinder"; + "Cone"; + "Pyramid"; + // "Tower of Hanoi"; + }; + StringList [ language_user1 ] = + { + "Quader" ; + "Zylinder" ; + "Kegel" ; + "Pyramiden" ; + }; + StringList [ english_us ] = + { + "Rectangular parallelepiped" ; + "Cylinder" ; + "Cone" ; + "Pyramid" ; + }; + StringList [ portuguese ] = + { + "Paraleleppedo" ; + "Cilindro" ; + "Cone" ; + "Pirmides" ; + }; + StringList [ russian ] = + { + "" ; + "" ; + "" ; + "" ; + }; + StringList [ dutch ] = + { + "blokken" ; + "cilinders" ; + "kegels" ; + "piramiden" ; + }; + StringList [ french ] = + { + "Paralllpipde" ; + "Cylindre" ; + "Cne" ; + "Pyramides" ; + }; + StringList [ spanish ] = + { + "Paraleleppedo" ; + "Cilindro" ; + "Cono" ; + "Pirmides" ; + }; + StringList [ italian ] = + { + "Parallelepipedo" ; + "Cilindro" ; + "Cono" ; + "Piramide" ; + }; + StringList [ danish ] = + { + "Kasser" ; + "Cylindre" ; + "Kegler" ; + "Pyramider" ; + }; + StringList [ swedish ] = + { + "Kvader" ; + "Cylinder" ; + "Kon" ; + "Pyramider" ; + }; + StringList [ polish ] = + { + "Prostopadocian" ; + "Walec" ; + "Stoek" ; + "Ostrosup" ; + }; + StringList [ portuguese_brazilian ] = + { + "Paraleleppedo retangular" ; + "Cilindro" ; + "Cone" ; + "Pirmide" ; + }; + StringList [ japanese ] = + { + "直方体" ; + "円柱" ; + "円錐" ; + "角錐" ; + }; + StringList [ chinese_simplified ] = + { + "直角平行六面体" ; + "圆柱体" ; + "圆锥体" ; + "棱锥体" ; + }; + StringList [ chinese_traditional ] = + { + "直角平行六面體" ; + "圓柱體" ; + "圓錐體" ; + "棱錐體" ; + }; + StringList [ arabic ] = + { + " " ; + "" ; + "" ; + "" ; + }; + StringList [ dutch ] = + { + "blokken" ; + "cilinders" ; + "kegels" ; + "piramiden" ; + }; + StringList [ chinese_simplified ] = + { + "直角平行六面体" ; + "圆柱体" ; + "圆锥体" ; + "棱锥体" ; + }; + StringList [ greek ] = + { + " " ; + "" ; + "K" ; + "" ; + }; + StringList [ korean ] = + { + "직육면체" ; + "실린더" ; + "원추형" ; + "피라미드" ; + }; + StringList [ turkish ] = + { + "Dikdrtgen prizma" ; + "Silindir" ; + "Koni" ; + "Piramit" ; + }; + StringList [ catalan ] = + { + "Paraleleppede" ; + "Cilindre" ; + "Con" ; + "Pirmides" ; + }; + StringList [ finnish ] = + { + "Suorakulmainen suuntaissrmi" ; + "Lieri" ; + "Kartio" ; + "Pyramidi" ; + }; + StringList [ thai ] = + { + "รูปปริมาตรที่มีด้าน 6 ด้าน" ; + "ทรงกระบอก" ; + "กรวย" ; + "ปิรามิด" ; + }; + StringList [ czech ] = + { + "Kvádr" ; + "Válec" ; + "Kužel" ; + "Jehlan" ; + }; + StringList [ hebrew ] = + { + "Quader" ; + "Zylinder" ; + "Kegel" ; + "Pyramiden" ; + }; + StringList [ hindi ] = + { + "चतुर्भुज" ; + "वर्तुलाकार" ; + "शंकु" ; + "स्तूप" ; + }; + StringList [ slovak ] = + { + "Kváder" ; + "Valec" ; + "Kužeľ" ; + "Ihlan" ; + }; + }; +}; diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx new file mode 100644 index 000000000000..d75ddf8058a5 --- /dev/null +++ b/chart2/source/controller/dialogs/tp_Scale.cxx @@ -0,0 +1,882 @@ +/************************************************************************* + * + * $RCSfile: tp_Scale.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "tp_Scale.hxx" + +#include "ResId.hxx" +#include "TabPages.hrc" +#include "Strings.hrc" +#include "SchSfxItemIds.hxx" + +#ifndef INCLUDED_RTL_MATH_HXX +#include <rtl/math.hxx> +#endif +// header for class SvxDoubleItem +#define ITEMID_DOUBLE 0 +#ifndef _SVX_CHRTITEM_HXX +#include <svx/chrtitem.hxx> +#endif +// header for class SfxBoolItem +#ifndef _SFXENUMITEM_HXX +#include <svtools/eitem.hxx> +#endif +// header for SfxInt32Item +#ifndef _SFXINTITEM_HXX +#include <svtools/intitem.hxx> +#endif + +// header for class WarningBox +#ifndef _SV_MSGBOX_HXX +#include <vcl/msgbox.hxx> +#endif + +/* +#ifndef _SV_MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif + +// header for class Table +#ifndef _TOOLS_TABLE_HXX +#include <tools/table.hxx> +#endif +*/ +// header for class SvNumberformat +#ifndef _ZFORMAT_HXX +#ifndef _ZFORLIST_DECLARE_TABLE +#define _ZFORLIST_DECLARE_TABLE +#endif +#include <svtools/zformat.hxx> +#endif +/* +// header for SvNumberFormatter +#ifndef _ZFORLIST_HXX +#include <svtools/zforlist.hxx> +#endif + +#include "schattr.hxx" +#define ITEMID_DOUBLE 0 +#ifndef _SVX_CHRTITEM_HXX //autogen +#include <svx/chrtitem.hxx> +#endif + +#include "schresid.hxx" +#include "strings.hrc" +#include "chtmodel.hxx" +#include "attrib.hxx" +#include "tpscaley.hxx" +#include "tpscaley.hrc" + +#include "chaxis.hxx" + +#include <rtl/math.hxx> +*/ +//............................................................................. +namespace chart +{ +//............................................................................. + +SchScaleYAxisTabPage::SchScaleYAxisTabPage(Window* pWindow,const SfxItemSet& rInAttrs) : + SfxTabPage(pWindow, SchResId(TP_SCALE_Y), rInAttrs), + + aFlScale(this, ResId(FL_SCALE_Y)), + aTxtMin (this, ResId (TXT_MIN)), + aFmtFldMin(this, ResId(EDT_MIN)), + aCbxAutoMin(this, ResId(CBX_AUTO_MIN)), + aTxtMax(this, ResId (TXT_MAX)), + aFmtFldMax(this, ResId(EDT_MAX)), + aCbxAutoMax(this, ResId(CBX_AUTO_MAX)), + aTxtMain (this, ResId (TXT_STEP_MAIN)), + aFmtFldStepMain(this, ResId(EDT_STEP_MAIN)), + aCbxAutoStepMain(this, ResId(CBX_AUTO_STEP_MAIN)), + aTxtHelp (this, ResId (TXT_STEP_HELP)), +// aFmtFldStepHelp(this, ResId(EDT_STEP_HELP)), + aMtStepHelp (this, ResId (MT_STEPHELP)), + aCbxAutoStepHelp(this, ResId(CBX_AUTO_STEP_HELP)), + aTxtOrigin (this, ResId (TXT_ORIGIN)), + aFmtFldOrigin(this, ResId(EDT_ORIGIN)), + aCbxAutoOrigin(this, ResId(CBX_AUTO_ORIGIN)), + aCbxLogarithm(this, ResId(CBX_LOGARITHM)), + + aFlTicks(this,ResId(FL_TICKS)), + aCbxTicksInner(this, ResId(CBX_TICKS_INNER)), + aCbxTicksOuter(this, ResId(CBX_TICKS_OUTER)), + + aFlHelpTicks(this,ResId(FL_HELPTICKS)), + aCbxHelpTicksInner(this, ResId(CBX_HELPTICKS_INNER)), + aCbxHelpTicksOuter(this, ResId(CBX_HELPTICKS_OUTER)), + + fMin(0.0), + fMax(0.0), + fStepMain(0.0), + nStepHelp(0), + fOrigin(0.0), + nAxisType(0), + rOutAttrs(rInAttrs), + pNumFormatter(NULL) //, +// bLastStepMain(FALSE) +{ + FreeResource(); + SetExchangeSupport(); + + aCbxAutoMin.SetClickHdl(LINK(this, SchScaleYAxisTabPage, EnableValueHdl)); + aCbxAutoMax.SetClickHdl(LINK(this, SchScaleYAxisTabPage, EnableValueHdl)); + aCbxAutoStepMain.SetClickHdl(LINK(this, SchScaleYAxisTabPage, EnableValueHdl)); + aCbxAutoStepHelp.SetClickHdl(LINK(this, SchScaleYAxisTabPage, EnableValueHdl)); + aCbxAutoOrigin.SetClickHdl(LINK(this, SchScaleYAxisTabPage, EnableValueHdl)); +// aCbxLogarithm.SetClickHdl(LINK(this, SchScaleYAxisTabPage, HandleLogs)); + const SfxPoolItem *pPoolItem = NULL; + if (rInAttrs.GetItemState(SCHATTR_AXISTYPE, TRUE, &pPoolItem) == SFX_ITEM_SET) + nAxisType = (int) ((const SfxInt32Item*)pPoolItem)->GetValue(); +} + +/************************************************************************* +|* +|* Werte-Editierfelder je nach Checkbox-Markierung enablen/disablen +|* +*************************************************************************/ + +IMPL_LINK( SchScaleYAxisTabPage, EnableValueHdl, CheckBox *, pCbx ) +{ + if (pCbx == &aCbxAutoMin) + { + aFmtFldMin.Enable(!aCbxAutoMin.IsChecked()); + } + else if (pCbx == &aCbxAutoMax) + { + aFmtFldMax.Enable(!aCbxAutoMax.IsChecked()); + } + else if (pCbx == &aCbxAutoStepMain) + { + aFmtFldStepMain.Enable(!aCbxAutoStepMain.IsChecked()); +// bLastStepMain = aCbxAutoStepMain.IsChecked(); + } + else if (pCbx == &aCbxAutoStepHelp) + { + aMtStepHelp.Show (); + aMtStepHelp.Enable( ! aCbxAutoStepHelp.IsChecked() ); + +// if (aCbxLogarithm.IsChecked ()) +// { +// // aFmtFldStepHelp.Hide (); +// aMtStepHelp.Show (); +// aMtStepHelp.Enable(!aCbxAutoStepHelp.IsChecked()); +// } +// else +// { +// // aFmtFldStepHelp.Show (); +// aMtStepHelp.Hide (); +// // aFmtFldStepHelp.Enable(!aCbxAutoStepHelp.IsChecked()); +// } + } + else if (pCbx == &aCbxAutoOrigin) + { + aFmtFldOrigin.Enable(!aCbxAutoOrigin.IsChecked()); + } + return 0; +} + +/************************************************************************* +|* +|* Erzeugung +|* +\*************************************************************************/ + +SfxTabPage* SchScaleYAxisTabPage::Create(Window* pWindow,const SfxItemSet& rOutAttrs) +{ + return new SchScaleYAxisTabPage(pWindow, rOutAttrs); +} + +/************************************************************************* +|* +|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen +|* +\*************************************************************************/ + +BOOL SchScaleYAxisTabPage::FillItemSet(SfxItemSet& rOutAttrs) +{ + DBG_ASSERT( pNumFormatter, "No NumberFormatter available" ); + + long nTicks=0; + long nHelpTicks=0; + + if(aCbxHelpTicksInner.IsChecked()) + nHelpTicks|=CHAXIS_MARK_INNER; + if(aCbxHelpTicksOuter.IsChecked()) + nHelpTicks|=CHAXIS_MARK_OUTER; + if(aCbxTicksInner.IsChecked()) + nTicks|=CHAXIS_MARK_INNER; + if(aCbxTicksOuter.IsChecked()) + nTicks|=CHAXIS_MARK_OUTER; + + rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_TICKS,nTicks)); + rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_HELPTICKS,nHelpTicks)); + + rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MIN ,aCbxAutoMin.IsChecked())); + rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_MAX ,aCbxAutoMax.IsChecked())); + rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_HELP,aCbxAutoStepHelp.IsChecked())); + rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_ORIGIN ,aCbxAutoOrigin.IsChecked())); + rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_LOGARITHM ,aCbxLogarithm.IsChecked())); + rOutAttrs.Put(SvxDoubleItem(fMax , SCHATTR_AXIS_MAX)); + rOutAttrs.Put(SvxDoubleItem(fMin , SCHATTR_AXIS_MIN)); + rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS_STEP_HELP, nStepHelp)); + rOutAttrs.Put(SvxDoubleItem(fOrigin , SCHATTR_AXIS_ORIGIN)); + + rOutAttrs.Put(SfxBoolItem(SCHATTR_AXIS_AUTO_STEP_MAIN,aCbxAutoStepMain.IsChecked())); + rOutAttrs.Put(SvxDoubleItem(fStepMain,SCHATTR_AXIS_STEP_MAIN)); + + return TRUE; +} + +/************************************************************************* +|* +|* Initialisierung +|* +\*************************************************************************/ + +void SchScaleYAxisTabPage::Reset(const SfxItemSet& rInAttrs) +{ + DBG_ASSERT( pNumFormatter, "No NumberFormatter available" ); + if(!pNumFormatter) + return; + + const SfxPoolItem *pPoolItem = NULL; + + long nTicks=0,nHelpTicks=0; + if(rInAttrs.GetItemState(SCHATTR_AXIS_TICKS,TRUE, &pPoolItem)== SFX_ITEM_SET) + nTicks=((const SfxInt32Item*)pPoolItem)->GetValue(); + if(rInAttrs.GetItemState(SCHATTR_AXIS_HELPTICKS,TRUE, &pPoolItem)== SFX_ITEM_SET) + nHelpTicks=((const SfxInt32Item*)pPoolItem)->GetValue(); + + aCbxHelpTicksInner.Check(nHelpTicks&CHAXIS_MARK_INNER); + aCbxHelpTicksOuter.Check(nHelpTicks&CHAXIS_MARK_OUTER); + aCbxTicksInner.Check(nTicks&CHAXIS_MARK_INNER); + aCbxTicksOuter.Check(nTicks&CHAXIS_MARK_OUTER); + + if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_MIN,TRUE,&pPoolItem) == SFX_ITEM_SET) + aCbxAutoMin.Check(((const SfxBoolItem*)pPoolItem)->GetValue()); + + if (rInAttrs.GetItemState(SCHATTR_AXIS_MIN,TRUE, &pPoolItem) == SFX_ITEM_SET) + { + fMin = ((const SvxDoubleItem*)pPoolItem)->GetValue(); + aFmtFldMin.SetValue( fMin ); + } + + if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_MAX,TRUE, &pPoolItem) == SFX_ITEM_SET) + aCbxAutoMax.Check(((const SfxBoolItem*)pPoolItem)->GetValue()); + + if (rInAttrs.GetItemState(SCHATTR_AXIS_MAX,TRUE, &pPoolItem) == SFX_ITEM_SET) + { + fMax = ((const SvxDoubleItem*)pPoolItem)->GetValue(); + aFmtFldMax.SetValue( fMax ); + } + + if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_MAIN,TRUE, &pPoolItem) == SFX_ITEM_SET) + aCbxAutoStepMain.Check(((const SfxBoolItem*)pPoolItem)->GetValue()); + + if (rInAttrs.GetItemState(SCHATTR_AXIS_STEP_MAIN,TRUE, &pPoolItem) == SFX_ITEM_SET) + { + fStepMain = ((const SvxDoubleItem*)pPoolItem)->GetValue(); + aFmtFldStepMain.SetValue( fStepMain ); + } + if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_STEP_HELP,TRUE, &pPoolItem) == SFX_ITEM_SET) + aCbxAutoStepHelp.Check(((const SfxBoolItem*)pPoolItem)->GetValue()); + if (rInAttrs.GetItemState(SCHATTR_AXIS_LOGARITHM,TRUE, &pPoolItem) == SFX_ITEM_SET) + aCbxLogarithm.Check(((const SfxBoolItem*)pPoolItem)->GetValue()); + if (rInAttrs.GetItemState(SCHATTR_AXIS_STEP_HELP,TRUE, &pPoolItem) == SFX_ITEM_SET) + { + nStepHelp = ((const SfxInt32Item*)pPoolItem)->GetValue(); +// if (aCbxLogarithm.IsChecked ()) + + aMtStepHelp.SetValue( nStepHelp ); + +// else +// { +// // aFmtFldStepHelp.SetValue( fStepHelp ); +// } + } + if (rInAttrs.GetItemState(SCHATTR_AXIS_AUTO_ORIGIN,TRUE, &pPoolItem) == SFX_ITEM_SET) + aCbxAutoOrigin.Check(((const SfxBoolItem*)pPoolItem)->GetValue()); + if (rInAttrs.GetItemState(SCHATTR_AXIS_ORIGIN,TRUE, &pPoolItem) == SFX_ITEM_SET) + { + fOrigin = ((const SvxDoubleItem*)pPoolItem)->GetValue(); + aFmtFldOrigin.SetValue( fOrigin ); + } + + EnableValueHdl(&aCbxAutoMin); + EnableValueHdl(&aCbxAutoMax); + EnableValueHdl(&aCbxAutoStepMain); + EnableValueHdl(&aCbxAutoStepHelp); + EnableValueHdl(&aCbxAutoOrigin); +// CheckLogControls (); +} + +/************************************************************************* +|* +|* Prueft die eingegebenen Werte +|* +\*************************************************************************/ + +int SchScaleYAxisTabPage::DeactivatePage(SfxItemSet* pItemSet) +{ + if( !pNumFormatter ) + { + DBG_ERROR( "No NumberFormatter available" ); + return LEAVE_PAGE; + } + + ULONG nIndex = pNumFormatter->GetStandardIndex(LANGUAGE_SYSTEM); + Edit* pEdit = NULL; + USHORT nErrStrId = 0; + double fDummy; + +// if( CheckLogs ()) +// return KEEP_PAGE; + + + fMax = aFmtFldMax.GetValue(); + fMin = aFmtFldMin.GetValue(); + fOrigin = aFmtFldOrigin.GetValue(); + fStepMain = aFmtFldStepMain.GetValue(); +// fStepHelp = aFmtFldStepHelp.GetValue(); + nStepHelp = aMtStepHelp.GetValue(); + + //do some reasonable automatic correction of user input if necessary + if (!aCbxAutoMax.IsChecked() && !aCbxAutoMin.IsChecked() && + fMin >= fMax) + { + //do not bother the user with error boxes + //just correct hte error and exchance minimum and maximum + double fSwap = fMin; + fMin = fMax; + fMax = fSwap; + /* + pEdit = &aFmtFldMin; + nErrStrId = STR_MINVALUE_LT_MAXVALUE; + */ + } + // check for entries in invalid ranges + if ( aCbxLogarithm.IsChecked() && + ( ( !aCbxAutoMin.IsChecked() && fMin <= 0.0 ) + || ( !aCbxAutoMax.IsChecked() && fMax <= 0.0 ) ) ) + { + //do not bother the user with error boxes for minimum greater 0 + //just set some suiteable default value + if( !aCbxAutoMax.IsChecked() && fMax<=0.0 ) + fMax = 100.0; + if( !aCbxAutoMin.IsChecked() && fMin<=0.0 ) + { + fMin = 0.1; + if(!aCbxAutoMax.IsChecked() && fMin>=fMax) + fMin = log(fMax)/10.0; + } + /* + pEdit = &aFmtFldMin; + nErrStrId = STR_BAD_LOGARITHM; + */ + } + if (!aCbxAutoStepHelp.IsChecked() && nStepHelp <= 0) + { + //do not bother the user with error boxes for minimum greater 0 + nStepHelp = 1; + /* + pEdit = &aFmtFldStepMain; + nErrStrId = STR_STEP_GT_ZERO; + */ + } + //user often forgets to switch visibility of help tickmarks on + if( !aCbxAutoStepHelp.IsChecked() && aMtStepHelp.IsModified() && nStepHelp > 1 + && !aCbxHelpTicksInner.IsChecked() && !aCbxHelpTicksOuter.IsChecked() ) + //&& !aCbxHelpTicksInner.IsModified() && !aCbxHelpTicksOuter.IsModified() ) + { + //check help ticks like main ticks + if(aCbxTicksInner.IsChecked()) + aCbxHelpTicksInner.Check(); + if(aCbxTicksOuter.IsChecked()) + aCbxHelpTicksOuter.Check(); + } + + //check wich entries need user action + + // check for entries that cannot be parsed for the current number format + if ( aFmtFldMin.IsModified() + && !aCbxAutoMin.IsChecked() + && !pNumFormatter->IsNumberFormat(aFmtFldMin.GetText(), nIndex, fDummy)) + { + pEdit = &aFmtFldMin; + nErrStrId = STR_INVALID_NUMBER; + } + else if (aFmtFldMax.IsModified() && !aCbxAutoMax.IsChecked() && + !pNumFormatter->IsNumberFormat(aFmtFldMax.GetText(), + nIndex, fDummy)) + { + pEdit = &aFmtFldMax; + nErrStrId = STR_INVALID_NUMBER; + } + else if (aFmtFldStepMain.IsModified() && !aCbxAutoStepMain.IsChecked() && + !pNumFormatter->IsNumberFormat(aFmtFldStepMain.GetText(), + nIndex, fDummy)) + { + pEdit = &aFmtFldStepMain; + nErrStrId = STR_INVALID_NUMBER; + } + /* + else if (!GetHelpValue ()) + { +// pEdit = &aFmtFldStepHelp; + nErrStrId = STR_INVALID_NUMBER; + } + */ + else if (aFmtFldOrigin.IsModified() && !aCbxAutoOrigin.IsChecked() && + !pNumFormatter->IsNumberFormat(aFmtFldOrigin.GetText(), + nIndex, fDummy)) + { + pEdit = &aFmtFldOrigin; + nErrStrId = STR_INVALID_NUMBER; + } + /* + //do not bother the user with error boxes for origin + //any values are tolerable + else if (!aCbxAutoOrigin.IsChecked() && aCbxLogarithm.IsChecked() && + fOrigin <= 0.0) + { + pEdit = &aFmtFldOrigin; + nErrStrId = STR_BAD_LOGARITHM; + } + */ + else if (!aCbxAutoStepMain.IsChecked() && fStepMain <= 0.0) + { + //show error message only if no reasonable value can be found here + if( !aCbxAutoMin.IsChecked() && !aCbxAutoMax.IsChecked() ) + { + if(aCbxLogarithm.IsChecked()) + fStepMain = 1.0; + else + fStepMain = (fMax - fMin)/2.0; + } + else + { + pEdit = &aFmtFldStepMain; + nErrStrId = STR_STEP_GT_ZERO; + } + } + /* + //do not bother the user with error boxes Main Step + //the main step is allowed to be greater than the visible range + else if (!aCbxAutoStepMain.IsChecked() && fStepMain > fabs( fMax - fMin )) + { + pEdit = &aFmtFldStepMain; + nErrStrId = STR_STEPMAIN_LT_MAXVALUE; + } + */ + // step may now be anything, independent from main step +// else if (!aCbxLogarithm.IsChecked () && !aCbxAutoStepHelp.IsChecked() && fStepHelp > fStepMain) +// { +// // pEdit = &aFmtFldStepHelp; +// nErrStrId = STR_STEPHELP_LT_STEPMAIN; +// } + /* + else + { + //do not bother the user with error boxes for origin + //any values are tolerable + if(( ! aCbxAutoMin.IsChecked() && + fOrigin < fMin ) || + ( ! aCbxAutoMax.IsChecked() && + fMax < fOrigin )) + { + nErrStrId = STR_WRONG_ORIGIN; + + if( ! aCbxAutoOrigin.IsChecked ()) + pEdit = &aFmtFldOrigin; + else if( ! aCbxAutoMin.IsChecked()) + pEdit = &aFmtFldMin; + else + pEdit = &aFmtFldMax; + } + } + */ + + if( ShowWarning( nErrStrId, pEdit ) ) + return KEEP_PAGE; + + if( pItemSet ) + FillItemSet( *pItemSet ); + + return LEAVE_PAGE; +} + +/************************************************************************* +|* +|* pruefe die eingaben fuer logarithmische werte +|* +*************************************************************************/ + +// IMPL_LINK( SchScaleYAxisTabPage, HandleLogs, CheckBox *, pCbx ) +// { +// CheckLogs (); + +// return 0; +// } + +/************************************************************************* +|* +|* pruefe die eingaben fuer logarithmische werte +|* +*************************************************************************/ + +// bool SchScaleYAxisTabPage::CheckLogs () +// { +// if( !pNumFormatter ) +// { +// DBG_ERROR( "No NumberFormatter available" ); +// return false; +// } + +// ULONG nIndex = pNumFormatter->GetStandardIndex(LANGUAGE_SYSTEM); +// Edit *pEdit = NULL; +// USHORT nErrStrId = 0; +// String aNumStr; +// double fDummy; + +// // CheckLogControls (); + +// if (!aCbxAutoMin.IsChecked ()) +// { +// fMin = aFmtFldMin.GetValue(); +// if (!pNumFormatter->IsNumberFormat(aFmtFldMin.GetText(), nIndex, fDummy)) +// { +// pEdit = &aFmtFldMin; +// nErrStrId = STR_INVALID_NUMBER; +// } +// else if (aCbxLogarithm.IsChecked ()) +// { +// if (fMin > 1.0) +// { +// double fVal = 1.0; + +// while (fVal < fMin) +// fVal *= 10.0; + +// if (fVal > fMin) fVal /= 10.0; +// fMin = fVal; +// } +// else if (fMin > 0.0) +// { +// double fVal = 1.0; + +// while (fVal > fMin) +// { +// fVal /= 10.0; +// if(::rtl::math::approxEqual(fVal,fMin)) +// fMin=fVal; //Double-Ungenauigkeiten (last-bits) ausgleichen +// } + +// fMin = fVal; +// } +// else fMin = 1.0; + +// aFmtFldMin.SetValue( fMin ); +// } +// } + +// if (!aCbxAutoMin.IsChecked ()) +// { +// fMax = aFmtFldMax.GetValue(); +// if( !pNumFormatter->IsNumberFormat(aFmtFldMax.GetText(), nIndex, fDummy)) +// { +// pEdit = &aFmtFldMax; +// nErrStrId = STR_INVALID_NUMBER; +// } +// else if (aCbxLogarithm.IsChecked ()) +// { +// if (fMax > 1.0) +// { +// double fVal = 1.0; + +// while (fVal < fMax) +// fVal *= 10.0; + +// fMax = fVal; +// } +// else if (fMax > 0.0) +// { +// double fVal = 1.0; + +// while (fVal > fMax) +// fVal /= 10.0; + +// if (fVal < fMax) fVal *= 10.0; +// fMax = fVal; +// } +// else fMax = 1.0; + +// aFmtFldMax.SetValue( fMax ); +// } +// } + +// BOOL bNewOrigin = FALSE; + +// if (aCbxAutoOrigin.IsChecked()) +// { +// if (fMax < 0.0) +// { +// fOrigin = fMax; +// bNewOrigin = TRUE; +// } +// if (fMin > 0.0) +// { +// fOrigin = fMin; +// bNewOrigin = TRUE; +// } +// if ((fMax >= 0.0) && (fMin <= 0.0)) +// { +// fOrigin = 0.0; +// bNewOrigin = TRUE; +// } +// } + +// if (aCbxLogarithm.IsChecked ()) +// { +// fOrigin = fMin; +// bNewOrigin = TRUE; +// } + +// if( bNewOrigin ) +// { +// aFmtFldOrigin.SetValue( fOrigin ); +// } + +// return ShowWarning( nErrStrId, pEdit ); +// } + +/************************************************************************* +|* +|* pruefe die eingaben fuer logarithmische werte +|* +*************************************************************************/ + +// bool SchScaleYAxisTabPage::CheckLogControls () +// { +// USHORT nErrorId = 0; +// Edit * pControl = NULL; + +// if( !pNumFormatter ) +// { +// DBG_ERROR( "No NumberFormatter available" ); +// return false; +// } + +// if (aCbxLogarithm.IsChecked ()) +// { +// ULONG nIndex = pNumFormatter->GetStandardIndex(LANGUAGE_SYSTEM); + +// // aFmtFldOrigin.Enable (FALSE); +// // aCbxAutoOrigin.Enable (FALSE); +// // aFmtFldStepMain.Enable (FALSE); +// // bLastStepMain = aCbxAutoStepMain.IsChecked(); +// // aCbxAutoStepMain.Check(); +// // aCbxAutoStepMain.Enable (FALSE); +// // aFmtFldStepHelp.Enable (FALSE); +// // aFmtFldStepHelp.Hide (); +// // aMtStepHelp.Show (); + +// double fNewMin; +// if (pNumFormatter->IsNumberFormat(aFmtFldMin.GetText(), nIndex, fNewMin )) +// { +// if (fNewMin <= 0.0) +// { +// nErrorId = STR_BAD_LOGARITHM; +// pControl = & aFmtFldMin; +// } +// else +// fMin = fNewMin; +// } +// else +// { +// nErrorId = STR_BAD_FORMAT; +// pControl = & aFmtFldMin; +// } + +// // aMtStepHelp.Enable (!aCbxAutoStepHelp.IsChecked ()); +// } +// // else +// // { +// // aCbxAutoStepMain.Check( bLastStepMain ); + +// // aCbxAutoOrigin.Enable (TRUE); +// // aCbxAutoStepMain.Enable (TRUE); + +// // aFmtFldStepHelp.Enable (!aCbxAutoStepHelp.IsChecked ()); + +// // aFmtFldStepHelp.Show (); +// // aMtStepHelp.Hide (); +// // } + +// aFmtFldOrigin.Enable (!aCbxAutoOrigin.IsChecked ()); +// aFmtFldStepMain.Enable (!aCbxAutoStepMain.IsChecked ()); +// aMtStepHelp.Enable (!aCbxAutoStepHelp.IsChecked ()); + +// return ShowWarning( nErrorId, pControl ); +// } + +/************************************************************************* +|* +|* pruefe die eingaben fuer logarithmische werte +|* +*************************************************************************/ + +/* +BOOL SchScaleYAxisTabPage::GetHelpValue () +{ + if (!aCbxAutoStepHelp.IsChecked()) + nStepHelp = aMtStepHelp.GetValue (); + return TRUE; + +// if (aCbxLogarithm.IsChecked ()) +// { +// if (!aCbxAutoStepHelp.IsChecked()) fStepHelp = aMtStepHelp.GetValue (); + +// return TRUE; +// } +// else +// { +// ULONG nIndex = pNumFormatter->GetStandardIndex(LANGUAGE_SYSTEM); +// double fDummy; + +// fStepHelp = aFmtFldStepHelp.GetValue(); +// return !(aFmtFldStepHelp.IsModified() && !aCbxAutoStepHelp.IsChecked() && +// !pNumFormatter->IsNumberFormat(aFmtFldStepHelp.GetText(), +// nIndex, fDummy)); +// } +} +*/ + +void SchScaleYAxisTabPage::SetNumFormatter( SvNumberFormatter* pFormatter ) +{ + pNumFormatter = pFormatter; + aFmtFldMax.SetFormatter( pNumFormatter ); + aFmtFldMin.SetFormatter( pNumFormatter ); + aFmtFldStepMain.SetFormatter( pNumFormatter ); +// aFmtFldStepHelp.SetFormatter( pNumFormatter ); + aFmtFldOrigin.SetFormatter( pNumFormatter ); + SetNumFormat(); +} + +void SchScaleYAxisTabPage::SetNumFormat() +{ + const SfxPoolItem *pPoolItem = NULL; + + if( rOutAttrs.GetItemState( SCHATTR_AXIS_NUMFMT, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + { + ULONG nFmt = (ULONG)((const SfxInt32Item*)pPoolItem)->GetValue(); + short eType = pNumFormatter->GetType( nFmt ); + + // change nFmt to an editable format (without loss of information) + if( eType == NUMBERFORMAT_CURRENCY ) // for currencies just display decimals + { + nFmt = pNumFormatter->GetStandardIndex(); + } + else + { + const SvNumberformat* pFormat = pNumFormatter->GetEntry( nFmt ); + if( pFormat ) + { + LanguageType eLanguage = pFormat->GetLanguage(); + nFmt = pNumFormatter->GetStandardFormat( nFmt, eType, eLanguage ); + } + // else: format is 'standard' + } + + aFmtFldMax.SetFormatKey( nFmt ); + aFmtFldMin.SetFormatKey( nFmt ); + aFmtFldOrigin.SetFormatKey( nFmt ); + + // for steps use standard format if date or time format is chosen + if( pNumFormatter && + ( eType == NUMBERFORMAT_DATE || + eType == NUMBERFORMAT_TIME || + eType == NUMBERFORMAT_DATETIME ) ) + { + nFmt = pNumFormatter->GetStandardIndex(); + } + + aFmtFldStepMain.SetFormatKey( nFmt ); +// aFmtFldStepHelp.SetFormatKey( nFmt ); + } +} + +bool SchScaleYAxisTabPage::ShowWarning( USHORT nResIdMessage, Edit * pControl /* = NULL */ ) +{ + if( nResIdMessage == 0 ) + return false; + + WarningBox( this, WinBits( WB_OK ), String( SchResId( nResIdMessage ))).Execute(); + if( pControl ) + { + pControl->GrabFocus(); + pControl->SetSelection( Selection( 0, SELECTION_MAX )); + } + return true; +} + +//............................................................................. +} //namespace chart +//............................................................................. + diff --git a/chart2/source/controller/dialogs/tp_Scale.hxx b/chart2/source/controller/dialogs/tp_Scale.hxx new file mode 100644 index 000000000000..d0004a9695e7 --- /dev/null +++ b/chart2/source/controller/dialogs/tp_Scale.hxx @@ -0,0 +1,178 @@ +/************************************************************************* + * + * $RCSfile: tp_Scale.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_TP_SCALES_HXX +#define _CHART2_TP_SCALES_HXX + +// header for SfxTabPage +#ifndef _SFXTABDLG_HXX +#include <sfx2/tabdlg.hxx> +#endif +// header for class FormattedField +#ifndef _FMTFIELD_HXX_ +#include <svtools/fmtfield.hxx> +#endif +// header for FixedText +#ifndef _SV_FIXED_HXX +#include <vcl/fixed.hxx> +#endif +// header for CheckBox +#ifndef _SV_BUTTON_HXX +#include <vcl/button.hxx> +#endif +// header for MetricField +#ifndef _SV_FIELD_HXX +#include <vcl/field.hxx> +#endif +//class SvNumberFormatter; + +//............................................................................. +namespace chart +{ +//............................................................................. + +class SchScaleYAxisTabPage : public SfxTabPage +{ +private: + FixedLine aFlScale; + + FixedText aTxtMin; + FormattedField aFmtFldMin; + CheckBox aCbxAutoMin; + + FixedText aTxtMax; + FormattedField aFmtFldMax; + CheckBox aCbxAutoMax; + + FixedText aTxtMain; + FormattedField aFmtFldStepMain; + CheckBox aCbxAutoStepMain; + + FixedText aTxtHelp; +// FormattedField aFmtFldStepHelp; + MetricField aMtStepHelp; + CheckBox aCbxAutoStepHelp; + + FixedText aTxtOrigin; + FormattedField aFmtFldOrigin; + CheckBox aCbxAutoOrigin; + CheckBox aCbxLogarithm; + + FixedLine aFlTicks; + CheckBox aCbxTicksInner; + CheckBox aCbxTicksOuter; + + FixedLine aFlHelpTicks; + CheckBox aCbxHelpTicksInner; + CheckBox aCbxHelpTicksOuter; + + double fMin; + double fMax; + double fStepMain; +// double fStepHelp; + sal_Int32 nStepHelp; + double fOrigin; + int nAxisType; + const SfxItemSet& rOutAttrs; + SvNumberFormatter* pNumFormatter; + +// BOOL bLastStepMain; + +// bool CheckLogs (); +// void CheckLogControls (); + +// BOOL GetHelpValue (); + + DECL_LINK( EnableValueHdl, CheckBox* ); +// DECL_LINK( HandleLogs, CheckBox * ); + + /** shows a warning window due to an invalid input. + + @param nResIdMessage + The resource identifier that represents the localized warning text. + If this is 0, no warning is shown and false is returned. + + @param pControl + If non-NULL, contains a pointer to the control in which the + errornous value was in. This method gives this control the focus + and selects its content. + + @return false, if nResIdMessage was 0, true otherwise + */ + bool ShowWarning( USHORT nResIdMessage, Edit * pControl = NULL ); + +public: + SchScaleYAxisTabPage( Window* pParent, const SfxItemSet& rInAttrs ); + + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rInAttrs ); + virtual BOOL FillItemSet( SfxItemSet& rOutAttrs ); + virtual void Reset( const SfxItemSet& rInAttrs ); + virtual int DeactivatePage( SfxItemSet* pItemSet = NULL ); + + void SetNumFormatter( SvNumberFormatter* pFormatter ); + void SetNumFormat(); +}; + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif + diff --git a/chart2/source/controller/dialogs/tp_Scale.src b/chart2/source/controller/dialogs/tp_Scale.src new file mode 100644 index 000000000000..35f4b9c358a9 --- /dev/null +++ b/chart2/source/controller/dialogs/tp_Scale.src @@ -0,0 +1,806 @@ +/************************************************************************* + * + * $RCSfile: tp_Scale.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "HelpIds.hrc" +#include "TabPages.hrc" + +TabPage TP_SCALE_Y +{ + Hide = TRUE ; + HelpID = HID_SCH_SCALE_Y ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 260 , 185 ) ; + + FixedLine FL_SCALE_Y + { + Pos = MAP_APPFONT ( 5 , 4 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text = "Achsenskalierung" ; + Text[ ENGLISH ] = "Scaling Axis" ; + Text[ norwegian ] = "Scaling Axis" ; + Text[ italian ] = "Scala degli assi" ; + Text[ portuguese_brazilian ] = "Escalonar eixos" ; + Text[ portuguese ] = "Escala de eixos" ; + Text[ finnish ] = "Skaalaa akselit" ; + Text[ danish ] = "Akseskalering" ; + Text[ french ] = "chelle de l'axe" ; + Text[ swedish ] = "Axelskalning" ; + Text[ dutch ] = "As-schaalverdeling" ; + Text[ spanish ] = "Escala de los ejes" ; + Text[ english_us ] = "Scale axes" ; + Text[ chinese_simplified ] = "轴的刻度显示"; + Text[ russian ] = " "; + Text[ polish ] = "Skaluj osie"; + Text[ japanese ] = "軸の目盛"; + Text[ chinese_traditional ] = "軸的顯示比例"; + Text[ arabic ] = " "; + Text[ dutch ] = "As-schaalverdeling"; + Text[ chinese_simplified ] = "轴的刻度显示"; + Text[ greek ] = " "; + Text[ korean ] = "축 배율 조정"; + Text[ turkish ] = "Eksenleri lekle"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Mida dels eixos"; + Text[ thai ] = "สเกลแกน"; + Text[ czech ] = "Měřítka os"; + Text[ hebrew ] = "Achsenskalierung"; + Text[ hindi ] = "अक्षों को स्केल करो"; + Text[ slovak ] = "Upraviť stupnicu osí"; + }; + FixedText TXT_MIN + { + Pos = MAP_APPFONT ( 11 , 16 ) ; + Size = MAP_APPFONT ( 88 , 8 ) ; + Text = "~Minimum:" ; + Text [ ENGLISH ] = "Min:" ; + Text [ dutch ] = "~Minimum:" ; + Text [ english_us ] = "~Minimum:" ; + Text [ italian ] = "~Minimo:" ; + Text [ spanish ] = "M~nimo:" ; + Text [ french ] = "M~inimum :" ; + Text [ swedish ] = "~Minimum:" ; + Text [ danish ] = "~Minimum:" ; + Text [ portuguese_brazilian ] = "~Mnimo:" ; + Text [ portuguese ] = "~Mnimo:" ; + Text[ chinese_simplified ] = "最小值(~M):"; + Text[ russian ] = ":"; + Text[ polish ] = "~Minimum:"; + Text[ japanese ] = "最小値(~M):"; + Text[ chinese_traditional ] = "最小值(~M):"; + Text[ arabic ] = " :"; + Text[ dutch ] = "~Minimum:"; + Text[ chinese_simplified ] = "最小值(~M):"; + Text[ greek ] = "~:"; + Text[ korean ] = "최소(~M):"; + Text[ turkish ] = "~Minimum:"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "M~nim:"; + Text[ finnish ] = "~Vhintn:"; + Text[ thai ] = "~น้อยที่สุด:"; + Text[ czech ] = "Minimum:"; + Text[ hebrew ] = "~Minimum:"; + Text[ hindi ] = "~न्यूनतम:"; + Text[ slovak ] = "~Minimum:"; + }; + SpinField EDT_MIN + { + Border = TRUE ; + SVLook = TRUE ; + Pos = MAP_APPFONT ( 103 , 14 ) ; + Size = MAP_APPFONT ( 50 , 12 ) ; + TabStop = TRUE ; + }; + CheckBox CBX_AUTO_MIN + { + Pos = MAP_APPFONT ( 159 , 15 ) ; + Size = MAP_APPFONT ( 88 , 10 ) ; + Text = "~Automatisch" ; + Text [ ENGLISH ] = "~Auto" ; + TabStop = TRUE ; + Text [ dutch ] = "A~utomatisch" ; + Text [ english_us ] = "Automatic" ; + Text [ italian ] = "Automatico" ; + Text [ spanish ] = "Automtico" ; + Text [ french ] = "Automatique" ; + Text [ swedish ] = "~Automatiskt" ; + Text [ danish ] = "~Automatisk" ; + Text [ portuguese_brazilian ] = "Automtico" ; + Text [ portuguese ] = "~Automtico" ; + Text[ chinese_simplified ] = "自动"; + Text[ russian ] = "~"; + Text[ polish ] = "Automatycznie"; + Text[ japanese ] = "自動"; + Text[ chinese_traditional ] = "自動"; + Text[ arabic ] = ""; + Text[ dutch ] = "A~utomatisch"; + Text[ chinese_simplified ] = "自动"; + Text[ greek ] = "~"; + Text[ korean ] = "자동"; + Text[ turkish ] = "~Otomatik"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Automtic"; + Text[ finnish ] = "Automaattinen"; + Text[ thai ] = "อัตโนมัติ"; + Text[ czech ] = "Automaticky"; + Text[ hebrew ] = "אוטומטי"; + Text[ hindi ] = "स्वचालित"; + Text[ slovak ] = "Automaticky"; + }; + + FixedText TXT_MAX + { + Pos = MAP_APPFONT ( 11 , 32 ) ; + Size = MAP_APPFONT ( 88 , 8 ) ; + Text = "Ma~ximum:" ; + Text [ ENGLISH ] = "Max:" ; + Text [ dutch ] = "Ma~ximum:" ; + Text [ english_us ] = "Ma~ximum:" ; + Text [ italian ] = "Massimo:" ; + Text [ spanish ] = "M~ximo:" ; + Text [ french ] = "M~aximum :" ; + Text [ swedish ] = "Ma~ximum:" ; + Text [ danish ] = "Maksimum:" ; + Text [ portuguese ] = "M~ximo:" ; + Text [ portuguese_brazilian ] = "M~ximo:" ; + Text[ chinese_simplified ] = "最大值(~X):"; + Text[ russian ] = ":"; + Text[ polish ] = "Ma~ksimum:"; + Text[ japanese ] = "最大値(~X):"; + Text[ chinese_traditional ] = "最大值(~X):"; + Text[ arabic ] = " :"; + Text[ dutch ] = "Ma~ximum:"; + Text[ chinese_simplified ] = "最大值(~X):"; + Text[ greek ] = "~:"; + Text[ korean ] = "최대(~X):"; + Text[ turkish ] = "Ma~ksimum:"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "M~xim:"; + Text[ finnish ] = "E~nintn:"; + Text[ thai ] = "มา~กที่สุด:"; + Text[ czech ] = "Maximum:"; + Text[ hebrew ] = "Ma~ximum:"; + Text[ hindi ] = "अधि~कतम:"; + Text[ slovak ] = "Ma~ximum:"; + }; + SpinField EDT_MAX + { + Border = TRUE ; + SVLook = TRUE ; + Pos = MAP_APPFONT ( 103 , 30 ) ; + Size = MAP_APPFONT ( 50 , 12 ) ; + TabStop = TRUE ; + }; + CheckBox CBX_AUTO_MAX + { + Pos = MAP_APPFONT ( 159 , 31 ) ; + Size = MAP_APPFONT ( 88 , 10 ) ; + Text = "A~utomatisch" ; + Text [ ENGLISH ] = "~Auto" ; + TabStop = TRUE ; + Text [ dutch ] = "~Automatisch" ; + Text [ english_us ] = "Automatic" ; + Text [ italian ] = "A~utomatico" ; + Text [ spanish ] = "Automtico" ; + Text [ french ] = "Automatique" ; + Text [ swedish ] = "A~utomatiskt" ; + Text [ danish ] = "A~utomatisk" ; + Text [ portuguese ] = "~Automtico" ; + Text [ portuguese_brazilian ] = "Automtico" ; + Text[ chinese_simplified ] = "自动"; + Text[ russian ] = "~"; + Text[ polish ] = "Automatycznie"; + Text[ japanese ] = "自動"; + Text[ chinese_traditional ] = "自動"; + Text[ arabic ] = ""; + Text[ dutch ] = "~Automatisch"; + Text[ chinese_simplified ] = "自动"; + Text[ greek ] = "~"; + Text[ korean ] = "자동"; + Text[ turkish ] = "O~tomatik"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Automtic"; + Text[ finnish ] = "Automaattinen"; + Text[ thai ] = "อัตโนมัติ"; + Text[ czech ] = "Automaticky"; + Text[ hebrew ] = "אוטומטי"; + Text[ hindi ] = "स्वचालित"; + Text[ slovak ] = "Automaticky"; + }; + + FixedText TXT_STEP_MAIN + { + Pos = MAP_APPFONT ( 11 , 48 ) ; + Size = MAP_APPFONT ( 88 , 8 ) ; + Text = "Hau~ptintervall:" ; + Text [ ENGLISH ] = "Ma~in Interval:" ; + Text [ english_us ] = "Major ~interval:" ; + Text [ italian ] = "Interv. ~princip." ; + Text [ spanish ] = "Intervalo prin~cipal:" ; + Text [ french ] = "Intervalle ~principal :" ; + Text [ dutch ] = "Hoo~fdinterval:" ; + Text [ swedish ] = "Huvudintervall:" ; + Text [ danish ] = "Overinterval:" ; + Text [ portuguese_brazilian ] = "Intervalo ~Principal:" ; + Text [ portuguese ] = "Intervalo ~principal:" ; + Text[ chinese_simplified ] = "主区间值(~I):"; + Text[ russian ] = " :"; + Text[ polish ] = "Przedz~ia g.:"; + Text[ japanese ] = "主間隔(~I):"; + Text[ chinese_traditional ] = "主區間值(~I):"; + Text[ arabic ] = " :"; + Text[ dutch ] = "Hoo~fdinterval:"; + Text[ chinese_simplified ] = "主区间值(~I):"; + Text[ greek ] = " ~:"; + Text[ korean ] = "주 간격(~I):"; + Text[ turkish ] = "Ana A~ralk:"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Interval principal"; + Text[ finnish ] = "P~vli:"; + Text[ thai ] = "~ช่วงหลัก:"; + Text[ czech ] = "Hlavní interval"; + Text[ hebrew ] = "Hau~ptintervall:"; + Text[ hindi ] = "प्रधान ~अंतराल:"; + Text[ slovak ] = "Väčší ~interval:"; + }; + SpinField EDT_STEP_MAIN + { + Border = TRUE ; + Pos = MAP_APPFONT ( 103 , 46 ) ; + Size = MAP_APPFONT ( 50 , 12 ) ; + TabStop = TRUE ; + }; + CheckBox CBX_AUTO_STEP_MAIN + { + Pos = MAP_APPFONT ( 159 , 47 ) ; + Size = MAP_APPFONT ( 88 , 10 ) ; + Text = "Au~tomatisch" ; + Text [ ENGLISH ] = "~Auto" ; + TabStop = TRUE ; + Text [ english_us ] = "Automatic" ; + Text [ italian ] = "Au~tomatico" ; + Text [ spanish ] = "Automtico" ; + Text [ french ] = "Automatique" ; + Text [ dutch ] = "A~utomatisch" ; + Text [ swedish ] = "Au~tomatiskt" ; + Text [ danish ] = "Au~tomatisk" ; + Text [ portuguese_brazilian ] = "Automtico" ; + Text [ portuguese ] = "~Automtico" ; + Text[ chinese_simplified ] = "自动"; + Text[ russian ] = "~"; + Text[ polish ] = "Automatycznie"; + Text[ japanese ] = "自動"; + Text[ chinese_traditional ] = "自動"; + Text[ arabic ] = ""; + Text[ dutch ] = "A~utomatisch"; + Text[ chinese_simplified ] = "自动"; + Text[ greek ] = "~"; + Text[ korean ] = "자동"; + Text[ turkish ] = "Oto~matik"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Automtic"; + Text[ finnish ] = "Automaattinen"; + Text[ thai ] = "อัตโนมัติ"; + Text[ czech ] = "Automaticky"; + Text[ hebrew ] = "אוטומטי"; + Text[ hindi ] = "स्वचालित"; + Text[ slovak ] = "Automaticky"; + }; + + FixedText TXT_STEP_HELP + { + Pos = MAP_APPFONT ( 11 , 64 ) ; + Size = MAP_APPFONT ( 88 , 8 ) ; + Text = "Teilinte~rvall:" ; + Text [ ENGLISH ] = "~Help Interval:" ; + Text [ dutch ] = "~Hulpinterval" ; + Text [ english_us ] = "Mi~nor interval:" ; + Text [ italian ] = "Interv. ausil." ; + Text [ spanish ] = "Intervalo a~uxiliar:" ; + Text [ french ] = "Intervalle secondaire :" ; + Text [ swedish ] = "Delintervall:" ; + Text [ danish ] = "Underinterval:" ; + Text [ portuguese_brazilian ] = "~Intervalo auxiliar:" ; + Text [ portuguese ] = "~Intervalo auxiliar:" ; + Text[ chinese_simplified ] = "次区间值(~N):"; + Text[ russian ] = " :"; + Text[ polish ] = "Przedzia pomocn.:"; + Text[ japanese ] = "補助間隔(~N):"; + Text[ chinese_traditional ] = "次區間值(~N):"; + Text[ arabic ] = " :"; + Text[ dutch ] = "~Hulpinterval"; + Text[ chinese_simplified ] = "次区间值(~N):"; + Text[ greek ] = "~. :"; + Text[ korean ] = "보조 간격(~N):"; + Text[ turkish ] = "K~k aralk"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Interval secu~ndari:"; + Text[ finnish ] = "Pie~ni vli:"; + Text[ thai ] = "ช่วงร~อง:"; + Text[ czech ] = "Vedlejší interval:"; + Text[ hebrew ] = "Teilinte~rvall:"; + Text[ hindi ] = "छो~टा अंतराल:"; + Text[ slovak ] = "Me~nší interval:"; + }; +// SpinField EDT_STEP_HELP +// { +// Border = TRUE ; +// SVLook = TRUE ; +// Pos = MAP_APPFONT ( 103 , 62 ) ; +// Size = MAP_APPFONT ( 50 , 12 ) ; +// TabStop = TRUE ; +// }; + MetricField MT_STEPHELP + { + Border = TRUE ; + Pos = MAP_APPFONT ( 103 , 62 ) ; + Size = MAP_APPFONT ( 50 , 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 1 ; + Maximum = 100 ; + StrictFormat = TRUE ; + Unit = FUNIT_CUSTOM ; + First = 1 ; + Last = 100 ; + SpinSize = 1 ; + }; + CheckBox CBX_AUTO_STEP_HELP + { + Pos = MAP_APPFONT ( 159 , 63 ) ; + Size = MAP_APPFONT ( 88 , 10 ) ; + Text = "Aut~omatisch" ; + Text [ ENGLISH ] = "~Auto" ; + TabStop = TRUE ; + Text [ dutch ] = "A~utomatisch" ; + Text [ english_us ] = "Automatic" ; + Text [ italian ] = "Aut~omatico" ; + Text [ spanish ] = "Automtico" ; + Text [ french ] = "Automatique" ; + Text [ swedish ] = "Aut~omatiskt" ; + Text [ danish ] = "Aut~omatisk" ; + Text [ portuguese_brazilian ] = "Automtico" ; + Text [ portuguese ] = "~Automtico" ; + Text[ chinese_simplified ] = "自动"; + Text[ russian ] = "~"; + Text[ polish ] = "Automatycznie"; + Text[ japanese ] = "自動"; + Text[ chinese_traditional ] = "自動"; + Text[ arabic ] = ""; + Text[ dutch ] = "A~utomatisch"; + Text[ chinese_simplified ] = "自动"; + Text[ greek ] = ""; + Text[ korean ] = "자동"; + Text[ turkish ] = "Otomat~ik"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Automtic"; + Text[ finnish ] = "Automaattinen"; + Text[ thai ] = "อัตโนมัติ"; + Text[ czech ] = "Automaticky"; + Text[ hebrew ] = "אוטומטי"; + Text[ hindi ] = "स्वचालित"; + Text[ slovak ] = "Automaticky"; + }; + + FixedText TXT_ORIGIN + { + Pos = MAP_APPFONT ( 11 , 80 ) ; + Size = MAP_APPFONT ( 88 , 8 ) ; + Text = "A~chse bei:" ; + Text [ ENGLISH ] = "~Axis at:" ; + Text [ dutch ] = "~As op:" ; + Text [ english_us ] = "~Axis at:" ; + Text [ italian ] = "Asse a:" ; + Text [ spanish ] = "~Eje en:" ; + Text [ french ] = "A~xe :" ; + Text [ swedish ] = "A~xel vid:" ; + Text [ danish ] = "Akse ved:" ; + Text [ portuguese_brazilian ] = "~Eixo em:" ; + Text [ portuguese ] = "~Eixo em:" ; + Text[ chinese_simplified ] = "轴位置(~A):"; + Text[ russian ] = "~ :"; + Text[ polish ] = "~O przy:"; + Text[ japanese ] = "基準線(~A):"; + Text[ chinese_traditional ] = "軸位置(~A):"; + Text[ arabic ] = " :"; + Text[ dutch ] = "~As op:"; + Text[ chinese_simplified ] = "轴位置(~A):"; + Text[ greek ] = "~ :"; + Text[ korean ] = "축의 기준(~A):"; + Text[ turkish ] = "E~ksen deeri:"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Eix a:"; + Text[ finnish ] = "~Akseli:"; + Text[ thai ] = "แ~กนที่:"; + Text[ czech ] = "Osa na:"; + Text[ hebrew ] = "A~chse bei:"; + Text[ hindi ] = "में ~अक्ष:"; + Text[ slovak ] = "Osi s~a pretínajú v:"; + }; + SpinField EDT_ORIGIN + { + Border = TRUE ; + SVLook = TRUE ; + Pos = MAP_APPFONT ( 103 , 78 ) ; + Size = MAP_APPFONT ( 50 , 12 ) ; + TabStop = TRUE ; + }; + CheckBox CBX_AUTO_ORIGIN + { + Pos = MAP_APPFONT ( 159 , 79 ) ; + Size = MAP_APPFONT ( 88 , 10 ) ; + Text = "Automati~sch" ; + Text [ ENGLISH ] = "~Auto" ; + TabStop = TRUE ; + Text [ dutch ] = "A~utomatisch" ; + Text [ english_us ] = "Automatic" ; + Text [ italian ] = "Automatico" ; + Text [ spanish ] = "Automtico" ; + Text [ french ] = "Automatique" ; + Text [ swedish ] = "Automati~skt" ; + Text [ danish ] = "Automati~sk" ; + Text [ portuguese_brazilian ] = "Automtico" ; + Text [ portuguese ] = "~Automtico" ; + Text[ chinese_simplified ] = "自动"; + Text[ russian ] = ""; + Text[ polish ] = "Automatycznie"; + Text[ japanese ] = "自動"; + Text[ chinese_traditional ] = "自動"; + Text[ arabic ] = ""; + Text[ dutch ] = "A~utomatisch"; + Text[ chinese_simplified ] = "自动"; + Text[ greek ] = ""; + Text[ korean ] = "자동"; + Text[ turkish ] = "Otomatik"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Automtic"; + Text[ finnish ] = "Automaattinen"; + Text[ thai ] = "อัตโนมัติ"; + Text[ czech ] = "Automaticky"; + Text[ hebrew ] = "אוטומטי"; + Text[ hindi ] = "स्वचालित"; + Text[ slovak ] = "Automaticky"; + }; + + CheckBox CBX_LOGARITHM + { + Pos = MAP_APPFONT ( 11 , 97 ) ; + Size = MAP_APPFONT ( 236 , 10 ) ; + Text = "~Logarithmische Skalierung" ; + Text [ ENGLISH ] = "~Logarithmic Scaling:" ; + Text [ norwegian ] = "~Logarithmic Scaling:" ; + Text [ italian ] = "Scala ~logaritmica:" ; + Text [ portuguese_brazilian ] = "Escala ~logartmica" ; + Text [ portuguese ] = "Escala de ~logoritmos:" ; + Text [ finnish ] = "Logaritmia~steikko" ; + Text [ danish ] = "~Logaritmisk skalering" ; + Text [ french ] = "~chelle logarithmique" ; + Text [ swedish ] = "~Logaritmisk skalning" ; + Text [ dutch ] = "~Logaritmische schaalverdeling" ; + Text [ spanish ] = "~Escala logartmica" ; + Text [ english_us ] = "Logarithmic ~scale" ; + TabStop = TRUE ; + Text[ chinese_simplified ] = "对数型刻度显示(~S)"; + Text[ russian ] = " "; + Text[ polish ] = "~Skala logarytmiczna"; + Text[ japanese ] = "対数目盛(~S)"; + Text[ chinese_traditional ] = "對數的顯示比例(~S)"; + Text[ arabic ] = " "; + Text[ dutch ] = "~Logaritmische schaalverdeling"; + Text[ chinese_simplified ] = "对数型刻度显示(~S)"; + Text[ greek ] = "~ "; + Text[ korean ] = "대수적 확대(~S)"; + Text[ turkish ] = "~Logaritmik leklendirme"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Escalat logartmic"; + Text[ thai ] = "~สเกลแบบลอการิธึม"; + Text[ czech ] = "Logaritmické měřítko"; + Text[ hebrew ] = "~Logarithmische Skalierung"; + Text[ hindi ] = "लघुगणकविधि ~स्केल"; + Text[ slovak ] = "~Logaritmická stupnica"; + }; + + FixedLine FL_TICKS + { + Pos = MAP_APPFONT ( 6 , 116 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text = "Marken fr Hauptintervalle" ; + Text[ ENGLISH ] = "tick marks" ; + Text[ english_us ] = "Major interval marks"; + Text[ portuguese ] = "Marcas de eixos"; + Text[ russian ] = " "; + Text[ dutch ] = "Asmarkeringen"; + Text[ french ] = "Marques pour l'intervalle principal"; + Text[ spanish ] = "Marcas para el intervalo principal"; + Text[ italian ] = "Contrassegni degli intervalli principali"; + Text[ danish ] = "Aksemarkeringer"; + Text[ swedish ] = "Markeringar fr huvudintervall"; + Text[ polish ] = "Znaczniki osi"; + Text[ portuguese_brazilian ] = "Marcas nos eixos"; + Text[ japanese ] = "軸の区切り"; + Text[ chinese_simplified ] = "主区间值的标记"; + Text[ chinese_traditional ] = "主區間值標記"; + Text[ arabic ] = " "; + Text[ dutch ] = "Asmarkeringen"; + Text[ chinese_simplified ] = "主区间值的标记"; + Text[ greek ] = " "; + Text[ korean ] = "주 간격 표시"; + Text[ turkish ] = "Byk aralk iaretleri"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Marques d'eix"; + Text[ finnish ] = "Akselimerkit"; + Text[ thai ] = "เครื่องหมายแกน"; + Text[ czech ] = "Značky na osách"; + Text[ hebrew ] = "Marken für Hauptintervalle"; + Text[ hindi ] = "अक्ष संकेत"; + Text[ slovak ] = "Značky na osi"; + }; + + CheckBox CBX_TICKS_INNER + { + Pos = MAP_APPFONT ( 11 , 127 ) ; + Size = MAP_APPFONT ( 78 , 10 ) ; + Text = "~innen"; + Text[ ENGLISH ] = "~inner"; + Text[ english_us ] = "inn~er"; + Text[ portuguese ] = "~interior"; + Text[ russian ] = "~"; + Text[ dutch ] = "~binnenste"; + Text[ french ] = "~Intrieur"; + Text[ spanish ] = "~interior"; + Text[ italian ] = "~Interno"; + Text[ danish ] = "indre"; + Text[ swedish ] = "~inre"; + Text[ polish ] = "wewntrz"; + Text[ portuguese_brazilian ] = "~interior"; + Text[ japanese ] = "内側(~E)"; + Text[ chinese_simplified ] = "内(~E)"; + Text[ chinese_traditional ] = "內(~E)"; + Text[ arabic ] = ""; + Text[ dutch ] = "~binnenste"; + Text[ chinese_simplified ] = "内(~E)"; + Text[ greek ] = "~"; + Text[ korean ] = "내부(~E)"; + Text[ turkish ] = "~ierde"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "int~erior"; + Text[ finnish ] = "si~sempi"; + Text[ thai ] = "ภายใ~น"; + Text[ czech ] = "vnitřní"; + Text[ hebrew ] = "~innen"; + Text[ hindi ] = "भीत~री"; + Text[ slovak ] = "~vnútorné"; + }; + CheckBox CBX_TICKS_OUTER + { + Pos = MAP_APPFONT ( 93 , 127 ) ; + Size = MAP_APPFONT ( 78 , 10 ) ; + Text = "au~en"; + Text[ ENGLISH ] = "~outer"; + Text[ english_us ] = "~outer"; + Text[ portuguese ] = "~exterior"; + Text[ russian ] = ""; + Text[ dutch ] = "~buitenste"; + Text[ french ] = "~Extrieur"; + Text[ spanish ] = "~exterior"; + Text[ italian ] = "Esterno"; + Text[ danish ] = "ydre"; + Text[ swedish ] = "~yttre"; + Text[ polish ] = "~na zewntrz"; + Text[ portuguese_brazilian ] = "~exterior"; + Text[ japanese ] = "外側(~O)"; + Text[ chinese_simplified ] = "外(~O)"; + Text[ chinese_traditional ] = "外(~O)"; + Text[ arabic ] = ""; + Text[ dutch ] = "~buitenste"; + Text[ chinese_simplified ] = "外(~O)"; + Text[ greek ] = "~"; + Text[ korean ] = "외부(~O)"; + Text[ turkish ] = "d~arda"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "exteri~or"; + Text[ finnish ] = "~ulompi"; + Text[ thai ] = "~ภายนอก"; + Text[ czech ] = "vnější"; + Text[ hebrew ] = "au~ßen"; + Text[ hindi ] = "~बाहरी"; + Text[ slovak ] = "v~onkajšie"; + }; + + FixedLine FL_HELPTICKS + { + Pos = MAP_APPFONT ( 6 , 149 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text = "Marken fr Teilintervalle" ; + Text[ ENGLISH ] = "tick marks" ; + Text[ english_us ] = "Minor interval marks"; + Text[ portuguese ] = "Marcas auxiliares"; + Text[ russian ] = " "; + Text[ dutch ] = "Hulpmarkeringen"; + Text[ french ] = "Marques pour l'intervalle secondaire"; + Text[ spanish ] = "Marcas para el intervalo auxiliar"; + Text[ italian ] = "Contrassegni per intervalli ausiliari"; + Text[ danish ] = "Hjlpemarkeringer"; + Text[ swedish ] = "Markeringar fr delintervall"; + Text[ polish ] = "Znaczniki podziaki"; + Text[ portuguese_brazilian ] = "Marcas auxiliares"; + Text[ japanese ] = "補助区切り"; + Text[ chinese_simplified ] = "次区间值的标记"; + Text[ chinese_traditional ] = "次區間值標記"; + Text[ arabic ] = " "; + Text[ dutch ] = "Hulpmarkeringen"; + Text[ chinese_simplified ] = "次区间值的标记"; + Text[ greek ] = " "; + Text[ korean ] = "보조 선택 표시"; + Text[ turkish ] = "Kk aralk iaretleri"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Marques auxiliars"; + Text[ finnish ] = "Jakoviivat"; + Text[ thai ] = "เครื่องหมายขีด"; + Text[ czech ] = "Stupnice"; + Text[ hebrew ] = "Marken für Teilintervalle"; + Text[ hindi ] = "टिक् मार्क"; + Text[ slovak ] = "Stupnica"; + }; + + CheckBox CBX_HELPTICKS_INNER + { + Pos = MAP_APPFONT ( 11 , 160 ); + Size = MAP_APPFONT ( 78 , 10 ) ; + Text = "inn~en"; + Text[ ENGLISH ] = "i~nner"; + Text[ english_us ] = "i~nner"; + Text[ portuguese ] = "i~nterior"; + Text[ russian ] = ""; + Text[ dutch ] = "bi~nnenste"; + Text[ french ] = "~Intrieur"; + Text[ spanish ] = "i~nterior"; + Text[ italian ] = "Int~erno"; + Text[ danish ] = "indre"; + Text[ swedish ] = "inr~e"; + Text[ polish ] = "~wewntrz"; + Text[ portuguese_brazilian ] = "i~nterior"; + Text[ japanese ] = "内側(~N)"; + Text[ chinese_simplified ] = "内(~N)"; + Text[ chinese_traditional ] = "內(~N)"; + Text[ arabic ] = ""; + Text[ dutch ] = "bi~nnenste"; + Text[ chinese_simplified ] = "内(~N)"; + Text[ greek ] = "~"; + Text[ korean ] = "내부(~N)"; + Text[ turkish ] = "ie~rde"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "i~nterior"; + Text[ finnish ] = "s~isempi"; + Text[ thai ] = "ภา~ยใน"; + Text[ czech ] = "vnitřní"; + Text[ hebrew ] = "inn~en"; + Text[ hindi ] = "भी~तरी"; + Text[ slovak ] = "vnú~torná"; + }; + CheckBox CBX_HELPTICKS_OUTER + { + Pos = MAP_APPFONT ( 93 , 160 ) ; + Size = MAP_APPFONT ( 78 , 10 ) ; + Text = "aue~n"; + Text[ ENGLISH ] = "o~uter"; + Text[ english_us ] = "o~uter"; + Text[ portuguese ] = "e~xterior"; + Text[ russian ] = ""; + Text[ dutch ] = "bu~itenste"; + Text[ french ] = "~Extrieur"; + Text[ spanish ] = "e~xterior"; + Text[ italian ] = "Ester~no"; + Text[ danish ] = "ydre"; + Text[ swedish ] = "ytt~re"; + Text[ polish ] = "na zewntrz"; + Text[ portuguese_brazilian ] = "e~xterior"; + Text[ japanese ] = "外側(~U)"; + Text[ chinese_simplified ] = "外(~U)"; + Text[ chinese_traditional ] = "外(~U)"; + Text[ arabic ] = ""; + Text[ dutch ] = "bu~itenste"; + Text[ chinese_simplified ] = "外(~U)"; + Text[ greek ] = "~"; + Text[ korean ] = "외부(~U)"; + Text[ turkish ] = "d~arda"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "e~xterior"; + Text[ finnish ] = "u~lompi"; + Text[ thai ] = "ภายน~อก"; + Text[ czech ] = "vnější"; + Text[ hebrew ] = "auße~n"; + Text[ hindi ] = "बा~हरी"; + Text[ slovak ] = "von~kajšia"; + }; +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx new file mode 100644 index 000000000000..ab74231b2afa --- /dev/null +++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx @@ -0,0 +1,213 @@ +/************************************************************************* + * + * $RCSfile: tp_SeriesToAxis.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "tp_SeriesToAxis.hxx" + +#include "ResId.hxx" +#include "TabPages.hrc" +#include "SchSfxItemIds.hxx" + +// header for class SfxBoolItem +#ifndef _SFXENUMITEM_HXX +#include <svtools/eitem.hxx> +#endif +// header for SfxInt32Item +#ifndef _SFXINTITEM_HXX +#include <svtools/intitem.hxx> +#endif + + +/* +#include "schattr.hxx" +#include "schresid.hxx" +#include "chtmodel.hxx" +#include "attrib.hxx" +#include "attrib.hrc" + +#ifndef _SVX_SVXIDS_HRC //autogen +#include <svx/svxids.hrc> +#endif +*/ + +//............................................................................. +namespace chart +{ +//............................................................................. + +SchOptionTabPage::SchOptionTabPage(Window* pWindow,const SfxItemSet& rInAttrs) : + SfxTabPage(pWindow, SchResId(TP_OPTIONS), rInAttrs), + aGrpAxis(this, ResId(GRP_OPT_AXIS)), + aGrpBar(this, ResId(GB_BAR)), + aRbtAxis1(this,ResId(RBT_OPT_AXIS_1)), + aRbtAxis2(this,ResId(RBT_OPT_AXIS_2)), + aMTOverlap(this,ResId(MT_OVERLAP)), + aMTGap(this,ResId(MT_GAP)), + aFTOverlap(this,ResId(FT_OVERLAP)), + aFTGap(this,ResId(FT_GAP)), + aCBConnect(this,ResId(CB_CONNECTOR)), + rOutAttrs(rInAttrs) +{ + FreeResource(); + +} +/************************************************************************* +|* +|* Dtor +|* +\************************************************************************/ + +SchOptionTabPage::~SchOptionTabPage() +{ +} + +/************************************************************************* +|* +|* Erzeugung +|* +\*************************************************************************/ + +SfxTabPage* SchOptionTabPage::Create(Window* pWindow,const SfxItemSet& rOutAttrs) +{ + return new SchOptionTabPage(pWindow, rOutAttrs); +} + +/************************************************************************* +|* +|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen +|* +\*************************************************************************/ +BOOL SchOptionTabPage::FillItemSet(SfxItemSet& rOutAttrs) +{ + if(aRbtAxis2.IsChecked()) + rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS,CHART_AXIS_SECONDARY_Y)); + else + rOutAttrs.Put(SfxInt32Item(SCHATTR_AXIS,CHART_AXIS_PRIMARY_Y)); + + if(aMTGap.IsVisible()) + rOutAttrs.Put(SfxInt32Item(CHATTR_DIAGRAM_GAPWIDTH,aMTGap.GetValue())); + + if(aMTOverlap.IsVisible()) + rOutAttrs.Put(SfxInt32Item(CHATTR_DIAGRAM_OVERLAP,aMTOverlap.GetValue())); + + if(aCBConnect.IsVisible()) + rOutAttrs.Put(SfxBoolItem(CHATTR_BARCONNECT,aCBConnect.IsChecked())); + + return TRUE; +} +/************************************************************************* +|* +|* Initialisierung +|* +\*************************************************************************/ + +void SchOptionTabPage::Reset(const SfxItemSet& rInAttrs) +{ + const SfxPoolItem *pPoolItem = NULL; + + aRbtAxis1.Check(TRUE); + aRbtAxis2.Check(FALSE); + if (rInAttrs.GetItemState(SCHATTR_AXIS,TRUE, &pPoolItem) == SFX_ITEM_SET) + { + long nVal=((const SfxInt32Item*)pPoolItem)->GetValue(); + if(nVal==CHART_AXIS_SECONDARY_Y) + { + aRbtAxis2.Check(TRUE); + aRbtAxis1.Check(FALSE); + } + } + + long nTmp; + if (rInAttrs.GetItemState(CHATTR_DIAGRAM_GAPWIDTH, TRUE, &pPoolItem) == SFX_ITEM_SET) + { + nTmp = (long)((const SfxInt32Item*)pPoolItem)->GetValue(); + aMTGap.SetValue(nTmp); + } + else + { + aMTGap.Show(FALSE); + aFTGap.Show(FALSE); + } + + if (rInAttrs.GetItemState(CHATTR_DIAGRAM_OVERLAP, TRUE, &pPoolItem) == SFX_ITEM_SET) + { + nTmp = (long)((const SfxInt32Item*)pPoolItem)->GetValue(); + aMTOverlap.SetValue(nTmp); + } + else + { + aMTOverlap.Show(FALSE); + aFTOverlap.Show(FALSE); + } + if (rInAttrs.GetItemState(CHATTR_BARCONNECT, TRUE, &pPoolItem) == SFX_ITEM_SET) + { + nTmp = (long)((const SfxInt32Item*)pPoolItem)->GetValue(); + aCBConnect.Check(nTmp); + } + else + { + aCBConnect.Show(FALSE); + } + + +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx new file mode 100644 index 000000000000..c8224299166f --- /dev/null +++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * $RCSfile: tp_SeriesToAxis.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_TP_SERIESTOAXIS_HXX +#define _CHART2_TP_SERIESTOAXIS_HXX + +// header for SfxTabPage +#ifndef _SFXTABDLG_HXX +#include <sfx2/tabdlg.hxx> +#endif +// header for FixedText +#ifndef _SV_FIXED_HXX +#include <vcl/fixed.hxx> +#endif +// header for CheckBox +#ifndef _SV_BUTTON_HXX +#include <vcl/button.hxx> +#endif +// header for MetricField +#ifndef _SV_FIELD_HXX +#include <vcl/field.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +class SchOptionTabPage : public SfxTabPage +{ +private: + FixedLine aGrpAxis; + RadioButton aRbtAxis1; + RadioButton aRbtAxis2; + + FixedLine aGrpBar; + FixedText aFTGap; + MetricField aMTGap; + FixedText aFTOverlap; + MetricField aMTOverlap; + CheckBox aCBConnect; + + const SfxItemSet& rOutAttrs; +public: + SchOptionTabPage(Window* pParent, const SfxItemSet& rInAttrs); + virtual ~SchOptionTabPage(); + + static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs); + virtual BOOL FillItemSet(SfxItemSet& rOutAttrs); + virtual void Reset(const SfxItemSet& rInAttrs); +}; + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif + diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.src b/chart2/source/controller/dialogs/tp_SeriesToAxis.src new file mode 100644 index 000000000000..095e67d03d80 --- /dev/null +++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.src @@ -0,0 +1,360 @@ +/************************************************************************* + * + * $RCSfile: tp_SeriesToAxis.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "HelpIds.hrc" +#include "TabPages.hrc" + +TabPage TP_OPTIONS +{ + Hide = TRUE ; +// HelpID = HID_LAYOUT ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 260 , 185 ) ; + FixedLine 1 + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text = "Datenreihe ausrichten an" ; + Text [ ENGLISH ]= "Assign Data Row To"; + Text[ english_us ] = "Align data series to"; + Text[ portuguese ] = "Alinhar srie de dados em"; + Text[ russian ] = " :"; + Text[ dutch ] = "Gegevensreeks uitlijnen aan"; + Text[ french ] = "Aligner la srie de donnes sur"; + Text[ spanish ] = "Alinear lnea de datos a"; + Text[ italian ] = "Allinea serie di dati a"; + Text[ danish ] = "Juster dataserie til"; + Text[ swedish ] = "Justera dataserie till"; + Text[ polish ] = "Wyrwnaj seri danych do"; + Text[ portuguese_brazilian ] = "Alinhar a srie de dados em"; + Text[ japanese ] = "データ系列の方向"; + Text[ chinese_simplified ] = "数据组对齐按照"; + Text[ chinese_traditional ] = "資料列對準依照"; + Text[ arabic ] = " :"; + Text[ dutch ] = "Gegevensreeks uitlijnen aan"; + Text[ chinese_simplified ] = "数据组对齐按照"; + Text[ greek ] = " "; + Text[ korean ] = "연속 데이터 맞춤:"; + Text[ turkish ] = "Veri serilerini buna hizala"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Alinea la lnia de dades a:"; + Text[ finnish ] = "Tietolhteiden tasaus:"; + Text[ thai ] = "จัดตำแหน่งชุดข้อมูลไปยัง:"; + Text[ czech ] = "Zarovnat série dat na"; + Text[ hebrew ] = "Datenreihe ausrichten an"; + Text[ hindi ] = "ड़ॉटा श्रृंखला को पंक्तिकरण करो:"; + Text[ slovak ] = "Zarovnať série dát na"; + }; + RadioButton RBT_OPT_AXIS_1 + { + Pos = MAP_APPFONT ( 12 , 14 ) ; + Size = MAP_APPFONT ( 80 , 10 ) ; + Text = "~Primrer Y-Achse" ; + Text [ ENGLISH ]= "~Primary Y axis"; + TabStop = TRUE ; + Text[ english_us ] = "Primary Y axis"; + Text[ portuguese ] = "Eixo Y ~primrio"; + Text[ russian ] = " Y"; + Text[ dutch ] = "~Primaire Y-as"; + Text[ french ] = "Axe Y ~primaire"; + Text[ spanish ] = "~Eje primario Y"; + Text[ italian ] = "Asse Y primario"; + Text[ danish ] = "~Primr Y-akse"; + Text[ swedish ] = "~Primr Y-axel"; + Text[ polish ] = "Gwna o Y"; + Text[ portuguese_brazilian ] = "Eixo Y Primrio"; + Text[ japanese ] = "第1Y軸"; + Text[ chinese_simplified ] = "Y 主轴"; + Text[ chinese_traditional ] = "主 Y 軸"; + Text[ arabic ] = " "; + Text[ dutch ] = "~Primaire Y-as"; + Text[ chinese_simplified ] = "Y 主轴"; + Text[ greek ] = "~ Y"; + Text[ korean ] = "1차 Y 축"; + Text[ turkish ] = "~Birincil Y ekseni"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Eix Y primari"; + Text[ finnish ] = "Ensisijainen Y-akseli"; + Text[ thai ] = "แกน Y ปฐมภูมิ"; + Text[ czech ] = "Primární osa Y"; + Text[ hebrew ] = "~Primärer Y-Achse"; + Text[ hindi ] = "प्रथम् Y अक्ष"; + Text[ slovak ] = "Primárna os Y"; + }; + RadioButton RBT_OPT_AXIS_2 + { + Pos = MAP_APPFONT ( 12 , 28 ) ; + Size = MAP_APPFONT ( 80 , 10 ) ; + Text = "~Sekundrer Y-Achse" ; + Text [ ENGLISH ]= "~Secondary Y axis"; + TabStop = TRUE ; + Text[ english_us ] = "2nd Y axis"; + Text[ portuguese ] = "Eixo Y ~secundrio"; + Text[ russian ] = " Y"; + Text[ dutch ] = "~Secundaire Y-as"; + Text[ french ] = "Axe Y ~secondaire"; + Text[ spanish ] = "Eje ~secundario Y"; + Text[ italian ] = "Asse Y secondario"; + Text[ danish ] = "~Sekundr Y-akse"; + Text[ swedish ] = "~Sekundr Y-axel"; + Text[ polish ] = "Pomocniczej osi Y"; + Text[ portuguese_brazilian ] = "Eixo Y secundrio"; + Text[ japanese ] = "第2Y軸"; + Text[ chinese_simplified ] = "Y 次轴"; + Text[ chinese_traditional ] = "次 Y 軸"; + Text[ arabic ] = " "; + Text[ dutch ] = "~Secundaire Y-as"; + Text[ chinese_simplified ] = "Y 次轴"; + Text[ greek ] = " ~ Y"; + Text[ korean ] = "2차 Y 축"; + Text[ turkish ] = "~kincil Y ekseni"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "2on eix Y"; + Text[ finnish ] = "Toinen Y-akseli"; + Text[ thai ] = "แกน Y แกนที่สอง"; + Text[ czech ] = "Upravit druhou osu Y"; + Text[ hebrew ] = "~Sekundärer Y-Achse"; + Text[ hindi ] = "दूसरा Y अक्ष"; + Text[ slovak ] = "Druhá os Y"; + }; + + FixedLine GB_BAR + { + Pos = MAP_APPFONT ( 6 , 44 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text = "Einstellungen" ; + Text [ ENGLISH ]= "Settings"; + Text[ english_us ] = "Settings"; + Text[ portuguese ] = "Definies"; + Text[ russian ] = ""; + Text[ dutch ] = "Instellingen"; + Text[ french ] = "Paramtres"; + Text[ spanish ] = "Configuracin"; + Text[ italian ] = "Impostazioni:"; + Text[ danish ] = "Indstillinger"; + Text[ swedish ] = "Instllningar"; + Text[ polish ] = "Ustawienia"; + Text[ portuguese_brazilian ] = "Definies"; + Text[ japanese ] = "設定"; + Text[ chinese_simplified ] = "设定"; + Text[ chinese_traditional ] = "設定"; + Text[ arabic ] = ":"; + Text[ dutch ] = "Instellingen"; + Text[ chinese_simplified ] = "设定"; + Text[ greek ] = ""; + Text[ korean ] = "설정:"; + Text[ turkish ] = "Tercihler"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Configuraci:"; + Text[ finnish ] = "Asetukset"; + Text[ thai ] = "ตั้งค่า"; + Text[ czech ] = "Nastavení"; + Text[ hebrew ] = "הגדרות"; + Text[ hindi ] = "निर्धारण"; + Text[ slovak ] = "Nastavenia"; + }; + FixedText FT_OVERLAP + { + Pos = MAP_APPFONT ( 12 , 73 ) ; + Size = MAP_APPFONT ( 47 , 8 ) ; + Text = "~berlapp" ; + Text [ ENGLISH ]= "~Overlap" ; + Text[ english_us ] = "~Overlap"; + Text[ portuguese ] = "~Sobrepor"; + Text[ russian ] = ""; + Text[ dutch ] = "~Overlappend"; + Text[ french ] = "~Chevauchement"; + Text[ spanish ] = "~Sobreponer"; + Text[ italian ] = "Sovrapponi"; + Text[ danish ] = "Overlap"; + Text[ swedish ] = "~verlappning"; + Text[ polish ] = "~Nakadanie"; + Text[ portuguese_brazilian ] = "~Sobrepor"; + Text[ japanese ] = "重ね合わせる(~O)"; + Text[ chinese_simplified ] = "重叠(~O)"; + Text[ chinese_traditional ] = "重疊(~O)"; + Text[ arabic ] = ""; + Text[ dutch ] = "~Overlappend"; + Text[ chinese_simplified ] = "重叠(~O)"; + Text[ greek ] = "~"; + Text[ korean ] = "겹침(~O)"; + Text[ turkish ] = "~Basamakla"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Superposa"; + Text[ finnish ] = "~Pllekkin"; + Text[ thai ] = "~ซ้อนทับ"; + Text[ czech ] = "Přesah"; + Text[ hebrew ] = "~Überlapp"; + Text[ hindi ] = "~Overlap"; + Text[ slovak ] = "~Presah"; + }; + + MetricField MT_OVERLAP + { + Border = TRUE ; + Pos = MAP_APPFONT ( 63 , 71 ) ; + Size = MAP_APPFONT ( 40 , 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = -100 ; + Maximum = 100 ; + StrictFormat = TRUE ; + Unit = FUNIT_CUSTOM ; + CustomUnitText = " %" ; + First = 1 ; + Last = 100 ; + SpinSize = 1 ; + DecimalDigits = 0 ; + }; + + FixedText FT_GAP + { + Pos = MAP_APPFONT ( 12 , 57 ) ; + Size = MAP_APPFONT ( 47 , 8 ) ; + Text = "~Abstand"; + Text [ ENGLISH ] = "~Gap"; + Text[ english_us ] = "~Spacing"; + Text[ portuguese ] = "~Espaamento"; + Text[ russian ] = ""; + Text[ dutch ] = "~Afstand"; + Text[ french ] = "cart"; + Text[ spanish ] = "~Espacio"; + Text[ italian ] = "Dist~anza"; + Text[ danish ] = "~Afstand"; + Text[ swedish ] = "~Avstnd"; + Text[ polish ] = "~Odstp"; + Text[ portuguese_brazilian ] = "A~fastamento"; + Text[ japanese ] = "間隔(~S)"; + Text[ chinese_simplified ] = "间隔(~S)"; + Text[ chinese_traditional ] = "間隔(~S)"; + Text[ arabic ] = ""; + Text[ dutch ] = "~Afstand"; + Text[ chinese_simplified ] = "间隔(~S)"; + Text[ greek ] = "~"; + Text[ korean ] = "간격(~S)"; + Text[ turkish ] = "~Uzaklk"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Espaiat"; + Text[ finnish ] = "~Objektivlit"; + Text[ thai ] = "~ระยะห่าง"; + Text[ czech ] = "Mezery"; + Text[ hebrew ] = "ריווח"; + Text[ hindi ] = "~अंतर देना"; + Text[ slovak ] = "~Medzery"; + }; + + MetricField MT_GAP + { + Border = TRUE ; + Pos = MAP_APPFONT ( 63 , 55 ) ; + Size = MAP_APPFONT ( 40 , 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 0 ; + Maximum = 600 ; + StrictFormat = TRUE ; + Unit = FUNIT_CUSTOM ; + CustomUnitText = " %" ; + First = 1 ; + Last = 100 ; + SpinSize = 1 ; + DecimalDigits = 0 ; + }; + + CheckBox CB_CONNECTOR + { + Pos = MAP_APPFONT ( 12 , 87 ) ; + Size = MAP_APPFONT ( 200 , 10 ) ; + Text = "~Verbindungslinien" ; + Text [ ENGLISH ]= "Connection Lines"; + TabStop = TRUE ; + Text[ english_us ] = "Connection Lines"; + Text[ portuguese ] = "~Linhas de ligao"; + Text[ russian ] = " "; + Text[ dutch ] = "~Verbindingslijnen"; + Text[ french ] = "Lignes de ~connexion"; + Text[ spanish ] = "Lneas ~conectoras"; + Text[ italian ] = "Linee di collegamento"; + Text[ danish ] = "Forbindelseslinjer"; + Text[ swedish ] = "~Frbindelselinjer"; + Text[ polish ] = "Linie pocze"; + Text[ portuguese_brazilian ] = "Linhas Conectoras"; + Text[ japanese ] = "接続線"; + Text[ chinese_simplified ] = "连接线"; + Text[ chinese_traditional ] = "連結線條"; + Text[ arabic ] = " "; + Text[ dutch ] = "~Verbindingslijnen"; + Text[ chinese_simplified ] = "连接线"; + Text[ greek ] = " ~"; + Text[ korean ] = "연결선"; + Text[ turkish ] = "~Balant izgileri"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Lnies ~connectoras"; + Text[ finnish ] = "Yhteysviivat"; + Text[ thai ] = "เชื่อมต่อบรรทัด"; + Text[ czech ] = "Spojovací čáry"; + Text[ hebrew ] = "~Verbindungslinien"; + Text[ hindi ] = "मिलाव रेखाएँ"; + Text[ slovak ] = "Spojovacie čiary"; + }; + +}; diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx new file mode 100644 index 000000000000..455b528f3912 --- /dev/null +++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx @@ -0,0 +1,376 @@ +/************************************************************************* + * + * $RCSfile: tp_TitleRotation.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "tp_TitleRotation.hxx" + +#include "ResId.hxx" +#include "TabPages.hrc" +#include "SchSfxItemIds.hxx" +/* +#include "Strings.hrc" +#include "Bitmaps.hrc" +#include "Bitmaps_HC.hrc" +*/ + +/* +#ifndef _SVX_SVXIDS_HRC //autogen +#include <svx/svxids.hrc> +#endif +#include "schattr.hxx" +*/ +// header for class SfxInt32Item +#ifndef _SFXINTITEM_HXX +#include <svtools/intitem.hxx> +#endif +//#define ITEMID_CHARTTEXTORDER SCHATTR_TEXT_ORDER +// #define ITEMID_CHARTTEXTORIENT SCHATTR_TEXT_ORIENT +#ifndef _SVX_CHRTITEM_HXX //autogen +#include <svx/chrtitem.hxx> +#endif +/* +#include "schresid.hxx" +#include "strings.hrc" +#include "chtmodel.hxx" +#include "attrib.hxx" +#include "attrib.hrc" +#include "app.hrc" +*/ + +//............................................................................. +namespace chart +{ +//............................................................................. + +SchAlignmentTabPage::SchAlignmentTabPage(Window* pWindow, + const SfxItemSet& rInAttrs) : + SfxTabPage(pWindow, SchResId(TP_ALIGNMENT), rInAttrs), + +// aCbxTextBreak ( this, ResId( CBX_TEXTBREAK ) ), +// aCbxTextOverlap ( this, ResId( CBX_TEXTOVERLAP ) ), +// aFlTextBreak ( this, ResId( FL_TEXTBREAK ) ), +// aRbtSideBySide(this, ResId(RBT_SIDEBYSIDE)), +// aRbtUpDown(this, ResId(RBT_UPDOWN)), +// aRbtDownUp(this, ResId(RBT_DOWNUP)), +// aRbtAutoOrder(this, ResId(RBT_AUTOORDER)), +// aFlOrder(this, ResId(FL_ORDER)), +// eOrderMode(CHORDMODE_X_AXIS), + rOutAttrs(rInAttrs), + + //Seit 4/1998 koennen Texte frei gedreht werden: SCHATTR_TEXT_DEGREES + aWinOrient ( this,ResId(CTR_DIAL),ResId(BTN_TXTSTACKED), + ResId(FT_DEGREES),ResId(NF_ORIENT), + ResId(FT_DUMMY), + ResId(CTR_DUMMY), + ResId( FL_ALIGN)) + +{ + FreeResource(); +} + +/************************************************************************* +|* +|* Dtor +|* +\************************************************************************/ + +SchAlignmentTabPage::~SchAlignmentTabPage() +{ +} + +/************************************************************************* +|* +|* Markierungs-Handler +|* +\************************************************************************/ + +/* +IMPL_LINK( SchAlignmentTabPage, CheckButtonHdl, Button *, pBtn ) +{ + + if (eOrderMode != CHORDMODE_NONE) + { + BOOL bEnable=TRUE; + aRbtSideBySide.Enable(bEnable); + aRbtUpDown.Enable(bEnable); + aRbtDownUp.Enable(bEnable); + aRbtAutoOrder.Enable(bEnable); + aFlOrder.Enable(bEnable); + } + return 0; +} +*/ + +/************************************************************************* +|* +|* Erzeugung +|* +\*************************************************************************/ + +SfxTabPage* SchAlignmentTabPage::Create(Window* pWindow, + const SfxItemSet& rOutAttrs) +{ + return new SchAlignmentTabPage(pWindow, rOutAttrs); +} + +/************************************************************************* +|* +|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen +|* +\*************************************************************************/ + +BOOL SchAlignmentTabPage::FillItemSet(SfxItemSet& rOutAttrs) +{ + //Seit 4/1998 koennen Texte frei gedreht werden: SCHATTR_TEXT_DEGREES +// SvxChartTextOrient eOrient; + BOOL bIsStacked = FALSE; + + long nDegrees=aWinOrient.GetDegrees()*100L; + rOutAttrs.Put(SfxInt32Item( SCHATTR_TEXT_DEGREES ,nDegrees) ); + + if (aWinOrient.IsStackedTxt()) + { +// eOrient = CHTXTORIENT_STACKED; + bIsStacked = TRUE; + rOutAttrs.Put(SfxInt32Item(SCHATTR_TEXT_DEGREES,0)); + } +// else +// { +// if(nDegrees==0) +// { +// eOrient = CHTXTORIENT_STANDARD; +// } +// else if(nDegrees <=18000) +// { +// eOrient = CHTXTORIENT_BOTTOMTOP; +// } +// else +// { +// eOrient = CHTXTORIENT_TOPBOTTOM; +// } +// } +// rOutAttrs.Put(SvxChartTextOrientItem(eOrient)); + rOutAttrs.Put( SfxBoolItem( SCHATTR_TEXT_STACKED, bIsStacked )); + + /* + if (eOrderMode != CHORDMODE_NONE) + { + SvxChartTextOrder eOrder; + +// if (aRbtUpDown.IsChecked()) eOrder = CHTXTORDER_UPDOWN; +// else if (aRbtDownUp.IsChecked()) eOrder = CHTXTORDER_DOWNUP; +// else if (aRbtAutoOrder.IsChecked()) eOrder = CHTXTORDER_AUTO; + else eOrder = CHTXTORDER_SIDEBYSIDE; + + rOutAttrs.Put(SvxChartTextOrderItem(eOrder)); + } + */ + + // Textumbruch +// BOOL bTextOverlap = aCbxTextOverlap.IsChecked(); +// rOutAttrs.Put( SfxBoolItem( SCHATTR_TEXT_OVERLAP, bTextOverlap ) ); + +// BOOL bTextBreak = aCbxTextBreak.IsChecked(); +// rOutAttrs.Put( SfxBoolItem( SID_TEXTBREAK, bTextBreak ) ); + + /* + BOOL bAttrsChanged = FALSE; + const SfxItemSet& rOldSet = GetItemSet(); + */ +// TriState eState; + + + + return TRUE; +} + +/************************************************************************* +|* +|* Initialisierung +|* +\*************************************************************************/ + +void SchAlignmentTabPage::Reset(const SfxItemSet& rInAttrs) +{ + const SfxPoolItem *pPoolItem = NULL; + + /* + if (rInAttrs.GetItemState(SCHATTR_TEXT_ORDER, + TRUE, &pPoolItem) == SFX_ITEM_SET && + eOrderMode != CHORDMODE_NONE) + { + switch (((const SvxChartTextOrderItem*)pPoolItem)->GetValue()) + { + case CHTXTORDER_SIDEBYSIDE: + aRbtSideBySide.Check(TRUE); + break; + + case CHTXTORDER_UPDOWN: + aRbtUpDown.Check(TRUE); + break; + + case CHTXTORDER_DOWNUP: + aRbtDownUp.Check(TRUE); + break; + + case CHTXTORDER_AUTO: + aRbtAutoOrder.Check(TRUE); + break; + } + } + */ + + //Seit 4/1998 koennen Texte frei gedreht werden: SCHATTR_TEXT_DEGREES + const SfxPoolItem* pItem ; + long nDegrees=0; + pItem = GetItem( rInAttrs, SCHATTR_TEXT_DEGREES ); + if(pItem) + { + nDegrees=((const SfxInt32Item*) pItem)->GetValue()/100; + } + +// if (rInAttrs.GetItemState(SCHATTR_TEXT_ORIENT, +// TRUE, &pPoolItem) == SFX_ITEM_SET) +// { +// SvxChartTextOrient eOrient = +// ((const SvxChartTextOrientItem*)pPoolItem)->GetValue(); + +// aWinOrient.SetDegrees((short)nDegrees); +// switch (eOrient) +// { +// case CHTXTORIENT_AUTOMATIC: +// break; + +// case CHTXTORIENT_STANDARD: +// break; + +// case CHTXTORIENT_TOPBOTTOM: +// if(!nDegrees) +// aWinOrient.SetDegrees(270); +// break; +// case CHTXTORIENT_BOTTOMTOP: +// if(!nDegrees) +// aWinOrient.SetDegrees(90); +// break; + +// case CHTXTORIENT_STACKED: +// aWinOrient.SetStackedTxt(TRUE); +// break; + +// } +// } + + aWinOrient.SetDegrees( static_cast< short >( nDegrees )); + if( rInAttrs.GetItemState( SCHATTR_TEXT_STACKED, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + { + aWinOrient.SetStackedTxt( reinterpret_cast< const SfxBoolItem * >( pPoolItem )->GetValue() ); + } + + // Textumbruch + /* + if( rInAttrs.GetItemState( SID_TEXTBREAK, FALSE, &pPoolItem ) >= SFX_ITEM_AVAILABLE ) + { + BOOL bTextBreak = ( (const SfxBoolItem*) pPoolItem)->GetValue(); +// aCbxTextBreak.Check( bTextBreak ); + } + else + { +// aCbxTextBreak.Hide(); +// aFlTextBreak.Hide(); + } + // Textueberlapp + if( (rInAttrs.GetItemState( SCHATTR_TEXT_OVERLAP, FALSE, &pPoolItem ) >= SFX_ITEM_AVAILABLE) && bTextCanOverlap) + { + BOOL bTextOverlap = ( (const SfxBoolItem*) pPoolItem)->GetValue(); +// aCbxTextOverlap.Check( bTextOverlap ); + } + else + { +// aCbxTextOverlap.Hide(); + } + */ +} + +/************************************************************************* +|* +|* Anordnungs-Controls hiden +|* +\*************************************************************************/ + +/* +void SchAlignmentTabPage::SetOrderMode(OrderMode eMode) +{ + eOrderMode = eMode; + + if (eOrderMode == CHORDMODE_NONE) + { + aRbtSideBySide.Hide(); + aRbtUpDown.Hide(); + aRbtDownUp.Hide(); + aRbtAutoOrder.Hide(); + aFlOrder.Hide(); + } +} +*/ + +//............................................................................. +} //namespace chart +//............................................................................. + + diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.hxx b/chart2/source/controller/dialogs/tp_TitleRotation.hxx new file mode 100644 index 000000000000..a22b37b9dd1b --- /dev/null +++ b/chart2/source/controller/dialogs/tp_TitleRotation.hxx @@ -0,0 +1,144 @@ +/************************************************************************* + * + * $RCSfile: tp_TitleRotation.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_TP_TITLEROTATION_HXX +#define _CHART2_TP_TITLEROTATION_HXX +/* +#include "SchSfxItemIds.hxx" +// header for enum SvxChartKindError +#include "SchAllDefinesFor_svx_chrtitem.hxx" +#ifndef _SVX_CHRTITEM_HXX //autogen +#include <svx/chrtitem.hxx> +#endif +*/ +// header for SfxTabPage +#ifndef _SFXTABDLG_HXX +#include <sfx2/tabdlg.hxx> +#endif +// header for SvxWinOrientation +#ifndef WORIENT_HXX //autogen +#include <svx/worient.hxx> +#endif +/* +// header for class ValueSet +#ifndef _VALUESET_HXX +#include <svtools/valueset.hxx> +#endif +*/ +// header for FixedLine +#ifndef _SV_FIXED_HXX +#include <vcl/fixed.hxx> +#endif +// header for CheckBox +#ifndef _SV_BUTTON_HXX +#include <vcl/button.hxx> +#endif +/* +// header for MetricField +#ifndef _SV_FIELD_HXX +#include <vcl/field.hxx> +#endif +*/ +//............................................................................. +namespace chart +{ +//............................................................................. + +class SchAlignmentTabPage : public SfxTabPage +{ +private: + + + //Seit 4/1998 koennen Texte frei gedreht werden: SID_ATTR_ALIGN_DEGREES + SvxWinOrientation aWinOrient; + +// CheckBox aCbxTextOverlap; + +// CheckBox aCbxTextBreak; +// FixedLine aFlTextBreak; + +// RadioButton aRbtSideBySide; +// RadioButton aRbtUpDown; +// RadioButton aRbtDownUp; +// RadioButton aRbtAutoOrder; +// FixedLine aFlOrder; +// OrderMode eOrderMode; + + const SfxItemSet& rOutAttrs; + +// DECL_LINK(CheckButtonHdl, Button*); + BOOL bTextCanOverlap; +public: + SchAlignmentTabPage(Window* pParent, const SfxItemSet& rInAttrs); + virtual ~SchAlignmentTabPage(); + + static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs); + virtual BOOL FillItemSet(SfxItemSet& rOutAttrs); + virtual void Reset(const SfxItemSet& rInAttrs); + +// void SetOrderMode(OrderMode eMode); + void SetTextCanOverlap(BOOL b){bTextCanOverlap=b;} +}; + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.src b/chart2/source/controller/dialogs/tp_TitleRotation.src new file mode 100644 index 000000000000..74b800b2cd46 --- /dev/null +++ b/chart2/source/controller/dialogs/tp_TitleRotation.src @@ -0,0 +1,484 @@ +/************************************************************************* + * + * $RCSfile: tp_TitleRotation.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "HelpIds.hrc" +#include "TabPages.hrc" + +#define MASKCOLOR MaskColor = Color { Red = 0xC000 ; Green = 0xC000 ; Blue = 0xC000 ; } + +TabPage TP_ALIGNMENT +{ + Hide = TRUE ; + HelpID = HID_SCH_ALIGNMENT ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 260 , 185 ) ; + Control CTR_DIAL + { + HelpId = HID_SCH_ALIGNMENT_CTR_DIAL ; + Pos = MAP_APPFONT ( 30 , 14 ) ; + Size = MAP_APPFONT ( 42 , 43 ) ; + Text = "ABCD" ; + }; + ImageButton BTN_TXTSTACKED + { + HelpId = HID_SCH_ALIGNMENT_STACKED ; + Pos = MAP_APPFONT ( 12 , 14 ) ; + Size = MAP_APPFONT ( 12 , 43 ) ; + TabStop = TRUE ; + ButtonImage = Image + { + ImageBitmap = Bitmap { File = "txtstk.bmp" ; }; + MASKCOLOR ; + }; + }; + FixedText FT_DEGREES + { + Pos = MAP_APPFONT ( 110 , 32 ) ; + Size = MAP_APPFONT ( 32 , 8 ) ; + Text = "Gra~d" ; + Text [ ENGLISH ] = "Degrees" ; + Text [ english_us ] = "~Degrees" ; + Text [ portuguese_brazilian ] = "Gr~aus" ; + Text [ swedish ] = "gra~der" ; + Text [ danish ] = "gra~der" ; + Text [ italian ] = "Gra~do" ; + Text [ spanish ] = "~Grados" ; + Text [ french ] = "Degr~s" ; + Text [ dutch ] = "Gra~den" ; + Text [ portuguese ] = "Gr~aus" ; + Text[ chinese_simplified ] = "度(~D)"; + Text[ russian ] = ""; + Text[ polish ] = "~Stopnie"; + Text[ japanese ] = "度(~D)"; + Text[ chinese_traditional ] = "度(~D)"; + Text[ arabic ] = ""; + Text[ dutch ] = "Gra~den"; + Text[ chinese_simplified ] = "度(~D)"; + Text[ greek ] = "~"; + Text[ korean ] = "도(~D)"; + Text[ turkish ] = "Der~ece"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Graus"; + Text[ finnish ] = "Ast~eet"; + Text[ thai ] = "~องศา"; + Text[ czech ] = "Stupňů"; + Text[ hebrew ] = "Gra~d"; + Text[ hindi ] = "~डिग्रियाँ"; + Text[ slovak ] = "Stup~ne"; + }; + NumericField NF_ORIENT + { + HelpId = HID_SCH_ALIGNMENT_DEGREES ; + Border = TRUE ; + Pos = MAP_APPFONT ( 78 , 30 ) ; + Size = MAP_APPFONT ( 28 , 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + StrictFormat = TRUE ; + }; + FixedText FT_DUMMY + { + //only necessary for constructor of SvxWinOrientation + Hide = TRUE ; + Pos = MAP_APPFONT ( 194 , 26 ) ; + Size = MAP_APPFONT ( 60 , 10 ) ; + Text = "unbenutzt" ; + //This text is never displayed and does therefore not have to be translated! + }; + Control CTR_DUMMY + { + //only necessary for constructor of SvxWinOrientation + Hide = TRUE ; + Pos = MAP_APPFONT ( 204 , 42 ) ; + Size = MAP_APPFONT ( 50 , 15 ) ; + //TabStop = TRUE ; + }; + FixedLine FL_ALIGN + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text = "Schreibrichtung" ; + Text [ ENGLISH ] = "Orientation" ; + Text [ norwegian ] = "Orientation" ; + Text [ italian ] = "Orientamento" ; + Text [ portuguese_brazilian ] = "Orientao do texto" ; + Text [ portuguese ] = "Orientao" ; + Text [ finnish ] = "Tekstin suunta" ; + Text [ danish ] = "Skriveretning" ; + Text [ french ] = "Orientation du texte" ; + Text [ swedish ] = "Skrivriktning" ; + Text [ dutch ] = "Schrijfrichting" ; + Text [ spanish ] = "Direccin de escritura" ; + Text [ english_us ] = "Text direction" ; + Text[ chinese_simplified ] = "书写方向"; + Text[ russian ] = " "; + Text[ polish ] = "Kierunek tekstu"; + Text[ japanese ] = "文字方向"; + Text[ chinese_traditional ] = "書寫方向"; + Text[ arabic ] = " "; + Text[ dutch ] = "Schrijfrichting"; + Text[ chinese_simplified ] = "书写方向"; + Text[ greek ] = " "; + Text[ korean ] = "텍스트 방향"; + Text[ turkish ] = "Metin ynlendirmesi"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Direcci d'escriptura"; + Text[ thai ] = "ทิศทางข้อความ"; + Text[ czech ] = "Směr textu"; + Text[ hebrew ] = "Schreibrichtung"; + Text[ hindi ] = "टेक्स्ट् दिशा"; + Text[ slovak ] = "Smer textu"; + }; + /* + FixedLine FL_ORDER + { + Pos = MAP_APPFONT ( 6 , 63 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text = "Anordnung" ; + Text [ ENGLISH ] = "Order" ; + Text [ norwegian ] = "Rekkeflge" ; + Text [ italian ] = "Disponi" ; + Text [ portuguese_brazilian ] = "Disposio" ; + Text [ portuguese ] = "Disposio" ; + Text [ english_us ] = "Arrangement" ; + Text [ spanish ] = "Disposicin" ; + Text [ french ] = "Disposition" ; + Text [ dutch ] = "Positie" ; + Text [ swedish ] = "Placering" ; + Text [ danish ] = "Placering" ; + Text[ chinese_simplified ] = "排序"; + Text[ russian ] = ""; + Text[ polish ] = "Rozmieszczenie"; + Text[ japanese ] = "整列"; + Text[ chinese_traditional ] = "排序"; + Text[ arabic ] = ""; + Text[ dutch ] = "Positie"; + Text[ chinese_simplified ] = "排序"; + Text[ greek ] = ""; + Text[ korean ] = "배치"; + Text[ turkish ] = "Dzenleme"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Posici"; + Text[ finnish ] = "Jrjest jrjestys"; + Text[ thai ] = "จัดเรียงคำสั่ง"; + Text[ czech ] = "Uspořádání"; + Text[ hebrew ] = "Anordnung"; + Text[ hindi ] = "व्यवस्था"; + Text[ slovak ] = "Usporiadanie"; + }; + RadioButton RBT_SIDEBYSIDE + { + Pos = MAP_APPFONT ( 12 , 74 ) ; + Size = MAP_APPFONT ( 70 , 10 ) ; + Text = "~Nebeneinander" ; + Text [ ENGLISH ] = "~Side by Side" ; + Text [ norwegian ] = "~Side by Side" ; + Text [ italian ] = "Affianca" ; + Text [ portuguese_brazilian ] = "~Lado a lado" ; + Text [ portuguese ] = "~Lado a lado" ; + Text [ english_us ] = "~Tile" ; + TabStop = TRUE ; + Text [ spanish ] = "~Mosaico" ; + Text [ french ] = "~Juxtaposer" ; + Text [ dutch ] = "~Naast elkaar" ; + Text [ swedish ] = "Bredvid vara~ndra" ; + Text [ danish ] = "Side om side" ; + Text[ chinese_simplified ] = "并排(~T)"; + Text[ russian ] = ""; + Text[ polish ] = "~Ssiadujco"; + Text[ japanese ] = "並べて配置(~T)"; + Text[ chinese_traditional ] = "並排(~T)"; + Text[ arabic ] = ""; + Text[ dutch ] = "~Naast elkaar"; + Text[ chinese_simplified ] = "并排(~T)"; + Text[ greek ] = " ~"; + Text[ korean ] = "바둑판식 배치(~T)"; + Text[ turkish ] = "~De"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Mosaic"; + Text[ finnish ] = "~Vierekkin"; + Text[ thai ] = "~ชื่อ"; + Text[ czech ] = "Dlaždice"; + Text[ hebrew ] = "~Nebeneinander"; + Text[ hindi ] = "~पटिया"; + Text[ slovak ] = "~Dlaždice"; + }; + RadioButton RBT_UPDOWN + { + Pos = MAP_APPFONT ( 12 , 88 ) ; + Size = MAP_APPFONT ( 70 , 10 ) ; + Text = "~Hoch-tief versetzt" ; + Text [ ENGLISH ] = "~Up-down transposed" ; + Text [ norwegian ] = "~Up-down transposed" ; + Text [ italian ] = "Sposta in alto/in basso" ; + Text [ portuguese_brazilian ] = "~mpares em cima" ; + Text [ portuguese ] = "~mpares em cima" ; + Text [ english_us ] = "Stagger ~odd" ; + TabStop = TRUE ; + Text [ spanish ] = "Organizacin i~mpar" ; + Text [ french ] = "Transposer ~haut-bas" ; + Text [ dutch ] = "~Hoog-laag verzet" ; + Text [ swedish ] = "Upphjt/nedsnkt" ; + Text [ danish ] = "Ulige tal forskudt" ; + Text[ chinese_simplified ] = "上下移动(~O)"; + Text[ russian ] = " ( )"; + Text[ polish ] = "Rozm. przest. (gra-d)"; + Text[ japanese ] = "上下に配置(~O)"; + Text[ chinese_traditional ] = "上下移動(~O)"; + Text[ arabic ] = " "; + Text[ dutch ] = "~Hoog-laag verzet"; + Text[ chinese_simplified ] = "上下移动(~O)"; + Text[ greek ] = "~ -"; + Text[ korean ] = "위 아래 엇갈림(~O)"; + Text[ turkish ] = "Yukar/aa hizalama"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Escalonament ~senar"; + Text[ finnish ] = "Lomita ~parittomat"; + Text[ thai ] = "สลับเลข~คี่"; + Text[ czech ] = "Předsunout liché"; + Text[ hebrew ] = "~Hoch-tief versetzt"; + Text[ hindi ] = "स्टाग्गेर् ~ऑड़"; + Text[ slovak ] = "P~osunúť nepárne"; + }; + RadioButton RBT_DOWNUP + { + Pos = MAP_APPFONT ( 12 , 102 ) ; + Size = MAP_APPFONT ( 70 , 10 ) ; + Text = "~Tief-hoch versetzt" ; + Text [ ENGLISH ] = "~Down-up transposed" ; + Text [ norwegian ] = "~Down-up transposed" ; + Text [ italian ] = "Sposta in basso/in alto" ; + Text [ portuguese_brazilian ] = "~Pares em cima" ; + Text [ portuguese ] = "~Pares em cima" ; + Text [ english_us ] = "Stagger ~even" ; + TabStop = TRUE ; + Text [ dutch ] = "~Hoog-laag verzet" ; + Text [ spanish ] = "Organizacin p~ar" ; + Text [ french ] = "Transposer ~bas-haut" ; + Text [ swedish ] = "Nedsnkt/upphjt" ; + Text [ danish ] = "Lige tal forskudt" ; + Text[ chinese_simplified ] = "下上移动(~E)"; + Text[ russian ] = " ( )"; + Text[ polish ] = "Rozm. przest. (d-gra)"; + Text[ japanese ] = "上下に配置(~E)"; + Text[ chinese_traditional ] = "下上移動(~E)"; + Text[ arabic ] = " "; + Text[ dutch ] = "~Hoog-laag verzet"; + Text[ chinese_simplified ] = "下上移动(~E)"; + Text[ greek ] = " ~-"; + Text[ korean ] = "아래 위 엇갈림(~E)"; + Text[ turkish ] = "Aa/yukar hizalama"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Escalonament ~parell"; + Text[ finnish ] = "Lomita ~parilliset"; + Text[ thai ] = "สลับเล~ขคู่"; + Text[ czech ] = "Předsunout sudé"; + Text[ hebrew ] = "~Tief-hoch versetzt"; + Text[ hindi ] = "स्टाग्गेर् ~इवन"; + Text[ slovak ] = "Posunúť párn~e"; + }; + RadioButton RBT_AUTOORDER + { + Pos = MAP_APPFONT ( 12 , 116 ) ; + Size = MAP_APPFONT ( 70 , 10 ) ; + Text = "~Automatisch" ; + Text [ ENGLISH ] = "~Automatic" ; + Text [ norwegian ] = "~Automatisk" ; + Text [ italian ] = "Automatico" ; + Text [ portuguese_brazilian ] = "~Automtico" ; + Text [ portuguese ] = "~Automtico" ; + Text [ english_us ] = "A~utomatic" ; + TabStop = TRUE ; + Text [ spanish ] = "~Automtico" ; + Text [ french ] = "Automatique" ; + Text [ dutch ] = "~Automatisch" ; + Text [ swedish ] = "~Automatiskt" ; + Text [ danish ] = "~Automatisk" ; + Text[ chinese_simplified ] = "自动(~U)"; + Text[ russian ] = ""; + Text[ polish ] = "A~utomatycznie"; + Text[ japanese ] = "自動(~U)"; + Text[ chinese_traditional ] = "自動(~U)"; + Text[ arabic ] = ""; + Text[ dutch ] = "~Automatisch"; + Text[ chinese_simplified ] = "自动(~U)"; + Text[ greek ] = "~"; + Text[ korean ] = "자동(~U)"; + Text[ turkish ] = "~Otomatik"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Automtic"; + Text[ finnish ] = "A~utomaattinen"; + Text[ thai ] = "อั~ตโนมัติ"; + Text[ czech ] = "Automaticky"; + Text[ hebrew ] = "אוטומטי"; + Text[ hindi ] = "स्व~यं-चालित"; + Text[ slovak ] = "A~utomaticky"; + }; + */ + /* + CheckBox CBX_TEXTBREAK + { + Pos = MAP_APPFONT ( 12 , 157 ) ; + Size = MAP_APPFONT ( 69 , 10 ) ; + + Text = "~Umbruch" ; + Text [ ENGLISH ] = "~Break" ; + Text [ english_us ] = "~Break" ; + Text [ portuguese_brazilian ] = "~Quebra" ; + Text [ swedish ] = "~Brytning" ; + Text [ danish ] = "Skift" ; + Text [ italian ] = "A capo" ; + Text [ spanish ] = "~Salto" ; + Text [ french ] = "~Saut" ; + Text [ dutch ] = "~Afbreking" ; + Text [ portuguese ] = "~Quebra" ; + Text[ chinese_simplified ] = "换行(~B)"; + Text[ russian ] = ""; + Text[ polish ] = "~Rozerwij"; + Text[ japanese ] = "改行(~B)"; + Text[ chinese_traditional ] = "換行(~B)"; + Text[ arabic ] = ""; + Text[ dutch ] = "~Afbreking"; + Text[ chinese_simplified ] = "换行(~B)"; + Text[ greek ] = "~"; + Text[ korean ] = "나누기(~B)"; + Text[ turkish ] = "~Kesme"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "~Salt"; + Text[ finnish ] = "~Vaihto"; + Text[ thai ] = "แ~บ่ง"; + Text[ czech ] = "Zalomení"; + Text[ hebrew ] = "~Umbruch"; + Text[ hindi ] = "~खण्डन"; + Text[ slovak ] = "~Zalomenie"; + }; + CheckBox CBX_TEXTOVERLAP + { + Pos = MAP_APPFONT ( 12 , 143 ) ; + Size = MAP_APPFONT ( 69 , 10 ) ; + + Text = "~berlappend" ; + Text [ ENGLISH ] = "" ; + Text [ english_us ] = "~Overlap" ; + Text [ portuguese_brazilian ] = "~Sobrepor" ; + Text [ swedish ] = "~verlappande" ; + Text [ danish ] = "Overlappet" ; + Text [ italian ] = "~Sovrapponi" ; + Text [ spanish ] = "~Sobreponer" ; + Text [ french ] = "~Chevauchement" ; + Text [ dutch ] = "~Overlappend" ; + Text [ portuguese ] = "Em ~cascata" ; + Text[ chinese_simplified ] = "重叠(~O)"; + Text[ russian ] = ""; + Text[ polish ] = "~Nakadanie"; + Text[ japanese ] = "重ね合わせる(~O)"; + Text[ chinese_traditional ] = "重疊(~O)"; + Text[ arabic ] = ""; + Text[ dutch ] = "~Overlappend"; + Text[ chinese_simplified ] = "重叠(~O)"; + Text[ greek ] = "~"; + Text[ korean ] = "겹침(~O)"; + Text[ turkish ] = "B~asamakla"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Superp~osa"; + Text[ finnish ] = "~Pllekkin"; + Text[ thai ] = "~ซ้อนทับ"; + Text[ czech ] = "Přesah"; + Text[ hebrew ] = "~Überlappend"; + Text[ hindi ] = "~Overlap"; + Text[ slovak ] = "~Presah"; + }; + FixedLine FL_TEXTBREAK + { + Pos = MAP_APPFONT ( 6 , 132 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + + Text = "Textfluss" ; + Text [ ENGLISH ] = "Textflow" ; + Text [ english_us ] = "Text flow" ; + Text[ portuguese ] = "Fluxo de texto"; + Text[ russian ] = " "; + Text[ greek ] = " "; + Text[ dutch ] = "Tekstverloop"; + Text[ french ] = "Enchanements"; + Text[ spanish ] = "Flujo de texto"; + Text[ italian ] = "Testo"; + Text[ danish ] = "Tekstretning"; + Text[ swedish ] = "Textflde"; + Text[ polish ] = "Przepyw tekstu"; + Text[ portuguese_brazilian ] = "Fluxo do texto"; + Text[ japanese ] = "体裁"; + Text[ korean ] = "텍스트 흐름"; + Text[ chinese_simplified ] = "换行和分页"; + Text[ chinese_traditional ] = "換行和分頁"; + Text[ arabic ] = " "; + Text[ turkish ] = "Metin ak"; + Text[ language_user1 ] = " "; + Text[ catalan ] = "Flux de text"; + Text[ finnish ] = "Tekstin rivitys"; + Text[ thai ] = "การไหลของข้อความ"; + Text[ czech ] = "Tok textu"; + Text[ hebrew ] = "Textfluss"; + Text[ hindi ] = "टेक्स्ट् धारा"; + Text[ slovak ] = "Tok textu"; + }; + */ +}; diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx new file mode 100644 index 000000000000..cd496c199ef1 --- /dev/null +++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx @@ -0,0 +1,156 @@ +/************************************************************************* + * + * $RCSfile: DrawViewWrapper.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "DrawViewWrapper.hxx" +#include "DrawModelWrapper.hxx" + +// header for class SdrPage +#ifndef _SVDPAGE_HXX +#include <svx/svdpage.hxx> +#endif +//header for class SdrPageView +#ifndef _SVDPAGV_HXX +#include <svx/svdpagv.hxx> +#endif +// header for class SdrModel +#ifndef _SVDMODEL_HXX +#include <svx/svdmodel.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +DrawViewWrapper::DrawViewWrapper( SdrModel* pModel, OutputDevice* pOut) + : E3dView(pModel, pOut) + , m_pWrappedDLPageView(NULL) + , m_pMarkHandleProvider(NULL) +{ + m_pWrappedDLPageView = this->ShowPagePgNum( 0, Point(0,0) ); + + /* + m_pWrappedDLPageView->GetPage()->SetBorder(0, 0, 0, 0); + m_pWrappedDLPageView->GetPage()->SetSize(Size(1000,1000)); + this->SetBordVisible(false); + this->SetPageBorderVisible(false); + */ +} + +DrawViewWrapper::~DrawViewWrapper() +{ + m_pWrappedDLPageView = NULL;//@ todo: sufficient? or remove necessary +} + +//virtual +void DrawViewWrapper::SetMarkHandles() +{ + if( m_pMarkHandleProvider && m_pMarkHandleProvider->getMarkHandles( aHdl ) ) + return; + else + SdrView::SetMarkHandles(); +} + +SdrObject* DrawViewWrapper::getHitObject( const Point& rPnt ) const +{ + const short HITPIX=2; //hit-tolerance in pixel + + SdrObject* pRet = NULL; + //ULONG nOptions =SDRSEARCH_DEEP|SDRSEARCH_PASS2BOUND|SDRSEARCH_PASS3NEAREST; + //ULONG nOptions = SDRSEARCH_TESTMARKABLE; + ULONG nOptions = SDRSEARCH_DEEP | SDRSEARCH_TESTMARKABLE; + //ULONG nOptions = SDRSEARCH_DEEP|SDRSEARCH_ALSOONMASTER|SDRSEARCH_WHOLEPAGE|SDRSEARCH_PASS2BOUND|SDRSEARCH_PASS3NEAREST; + //ULONG nOptions = 0; + + short nHitTolerance = 50; + { + OutputDevice* pOutDev = this->GetWin(0); + if(pOutDev) + nHitTolerance = pOutDev->PixelToLogic(Size(HITPIX,0)).Width(); + } + this->SdrView::PickObj(rPnt, nHitTolerance, pRet, m_pWrappedDLPageView, nOptions); + return pRet; +} + +void DrawViewWrapper::MarkObject( SdrObject* pObj ) +{ + bool bFrameDragSingles = true;//true == green == surrounding handles + pObj->SetMarkProtect(false); + if( m_pMarkHandleProvider ) + bFrameDragSingles = m_pMarkHandleProvider->getFrameDragSingles(); + this->SetFrameDragSingles(bFrameDragSingles);//decide wether each single object should get handles + this->SdrView::MarkObj( pObj, m_pWrappedDLPageView ); + this->SetMarkHdlHidden(FALSE); +} + + +void DrawViewWrapper::setMarkHandleProvider( MarkHandleProvider* pMarkHandleProvider ) +{ + m_pMarkHandleProvider = pMarkHandleProvider; +} + +void DrawViewWrapper::InitRedraw( OutputDevice* pOut, const Region& rReg ) +{ + this->E3dView::InitRedraw( pOut, rReg ); +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx new file mode 100644 index 000000000000..4c9a463fdba9 --- /dev/null +++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx @@ -0,0 +1,239 @@ +/************************************************************************* + * + * $RCSfile: ViewElementListProvider.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ViewElementListProvider.hxx" +#include "chartview/NumberFormatterWrapper.hxx" +#include "DrawModelWrapper.hxx" + +/* +#ifndef _SVDMODEL_HXX +#include <svx/svdmodel.hxx> +#endif +*/ + +//------------ +//oldChartModelWrapper +/* +// header for class SfxPrinter +#ifndef _SFX_PRINTER_HXX +#include <sfx2/printer.hxx> +#endif +*/ +// header for class FontList +#ifndef _CTRLTOOL_HXX +#include <svtools/ctrltool.hxx> +#endif +// header for class Application +#ifndef _SV_SVAPP_HXX +#include <vcl/svapp.hxx> +#endif +//------------ +/* +//for creation of own number formatter +#ifndef _COMPHELPER_PROCESSFACTORY_HXX_ +#include <comphelper/processfactory.hxx> +#endif +*/ + +//............................................................................. +namespace chart +{ +//............................................................................. +//using namespace ::com::sun::star; +//using namespace ::drafts::com::sun::star::chart2; + +ViewElementListProvider::ViewElementListProvider( DrawModelWrapper* pDrawModelWrapper + , NumberFormatterWrapper* pNumberFormatterWrapper ) + : m_pDrawModelWrapper( pDrawModelWrapper ) + , m_pFontList(NULL) + , m_pNumberFormatterWrapper(pNumberFormatterWrapper) +{ + DBG_ASSERT(m_pDrawModelWrapper,"A DrawModelWrapper is missing - maybe not all services can be provided"); + DBG_ASSERT(m_pNumberFormatterWrapper,"A Numberformatter is missing - maybe not all services can be provided"); +} + +ViewElementListProvider::~ViewElementListProvider() +{ + if(m_pFontList) + delete m_pFontList; +} + +XColorTable* ViewElementListProvider::GetColorTable() const +{ + if(m_pDrawModelWrapper) + return m_pDrawModelWrapper->GetColorTable(); + return NULL; +} +XDashList* ViewElementListProvider::GetDashList() const +{ + if(m_pDrawModelWrapper) + return m_pDrawModelWrapper->GetDashList(); + return NULL; +} +XLineEndList* ViewElementListProvider::GetLineEndList() const +{ + if(m_pDrawModelWrapper) + return m_pDrawModelWrapper->GetLineEndList(); + return NULL; +} +XGradientList* ViewElementListProvider::GetGradientList() const +{ + if(m_pDrawModelWrapper) + return m_pDrawModelWrapper->GetGradientList(); + return NULL; +} +XHatchList* ViewElementListProvider::GetHatchList() const +{ + if(m_pDrawModelWrapper) + return m_pDrawModelWrapper->GetHatchList(); + return NULL; +} +XBitmapList* ViewElementListProvider::GetBitmapList() const +{ + if(m_pDrawModelWrapper) + return m_pDrawModelWrapper->GetBitmapList(); + return NULL; +} + +//create chartspecific symbols for linecharts +SdrObjList* ViewElementListProvider::GetSymbolList() const +{ + // in old chart called GetSdrObjList + //@todo create symbols here + return NULL; +} + +FontList* ViewElementListProvider::getFontList() const +{ + //was old chart: + //SvxFontListItem* SfxObjectShell::.GetItem(SID_ATTR_CHAR_FONTLIST) + + if(!m_pFontList) + { + OutputDevice* pPrinter = NULL;//getPrinter(); + OutputDevice* pDefaultOut = Application::GetDefaultDevice(); // #67730# + m_pFontList = new FontList( pPrinter ? pPrinter : pDefaultOut + , pPrinter ? pDefaultOut : NULL + , FALSE ); + } + return m_pFontList; +} + +/* +SfxPrinter* OldModelWrapper::getPrinter() +{ + //was old chart: + //SfxPrinter* SchChartDocShell::GetPrinter() + + // OLE-Objekt: kein Printer anlegen ??? see old chart: :UpdateTablePointers + //@todo get printer from calc or other container + //return NULL; + + SfxPrinter* pPrinter = NULL; + bool bOwnPrinter = true; + if (!pPrinter) + { + SfxBoolItem aItem(SID_PRINTER_NOTFOUND_WARN, TRUE); + // ItemSet mit speziellem Poolbereich anlegen + SfxItemSet* pSet = new SfxItemSet(GetPool(), + SID_PRINTER_NOTFOUND_WARN, + SID_PRINTER_NOTFOUND_WARN, 0); + pSet->Put(aItem); + pPrinter = new SfxPrinter(pSet); //@todo ->need to remember and delete + bOwnPrinter = TRUE; + + MapMode aMapMode = pPrinter->GetMapMode(); + aMapMode.SetMapUnit(MAP_100TH_MM); + pPrinter->SetMapMode(aMapMode); + + if (pChDoc) + { + if (pPrinter != pChDoc->GetRefDevice()) + pChDoc->SetRefDevice(pPrinter); + + if (pPrinter != pChDoc->GetOutliner()->GetRefDevice()) + pChDoc->GetOutliner()->SetRefDevice(pPrinter); + } + } + return pPrinter; +} +*/ + +SvNumberFormatter* ViewElementListProvider::GetOwnNumberFormatter() const +{ + if( m_pNumberFormatterWrapper ) + return m_pNumberFormatterWrapper->getSvNumberFormatter(); + return NULL; + /* + static SvNumberFormatter aNumberFormatter = SvNumberFormatter( + ::comphelper::getProcessServiceFactory(), + LANGUAGE_SYSTEM ); + return &aNumberFormatter; + */ +} +SvNumberFormatter* ViewElementListProvider::GetNumFormatter() const +{ + //@todo + return GetOwnNumberFormatter(); +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/drawinglayer/makefile.mk b/chart2/source/controller/drawinglayer/makefile.mk new file mode 100644 index 000000000000..a20916f46c2e --- /dev/null +++ b/chart2/source/controller/drawinglayer/makefile.mk @@ -0,0 +1,84 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ= ..$/..$/.. +PRJINC= $(PRJ)$/source +PRJNAME= chart2 +TARGET= chcdrawinglayer + +ENABLE_EXCEPTIONS= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: settings.mk + +# --- export library ------------------------------------------------- + +#object files to build and link together to lib $(SLB)$/$(TARGET).lib +SLOFILES= $(SLO)$/DrawModelWrapper.obj \ + $(SLO)$/DrawViewWrapper.obj \ + $(SLO)$/ViewElementListProvider.obj + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk + diff --git a/chart2/source/controller/inc/AxisItemConverter.hxx b/chart2/source/controller/inc/AxisItemConverter.hxx new file mode 100644 index 000000000000..c17400483339 --- /dev/null +++ b/chart2/source/controller/inc/AxisItemConverter.hxx @@ -0,0 +1,129 @@ +/************************************************************************* + * + * $RCSfile: AxisItemConverter.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_AXISITEMCONVERTER_HXX +#define CHART_AXISITEMCONVERTER_HXX + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XAXIS_HPP_ +#include <drafts/com/sun/star/chart2/XAxis.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_EXPLICITSCALEDATA_HPP_ +#include <drafts/com/sun/star/chart2/ExplicitScaleData.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_EXPLICITINCREMENTDATA_HPP_ +#include <drafts/com/sun/star/chart2/ExplicitIncrementData.hpp> +#endif + +#include "ItemConverter.hxx" +#include "chartview/NumberFormatterWrapper.hxx" + +#include <vector> + +class SdrModel; + +namespace chart +{ +namespace wrapper +{ + +class AxisItemConverter : public ItemConverter +{ +public: + AxisItemConverter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropertySet, + SfxItemPool& rItemPool, + SdrModel& rDrawModel, + NumberFormatterWrapper * pNumFormatter, + ::drafts::com::sun::star::chart2::ExplicitScaleData * pScale = NULL, + ::drafts::com::sun::star::chart2::ExplicitIncrementData * pIncrement = NULL, + double * pExplicitOrigin = NULL ); + virtual ~AxisItemConverter(); + + virtual void FillItemSet( SfxItemSet & rOutItemSet ) const; + virtual bool ApplyItemSet( const SfxItemSet & rItemSet ); + +protected: + virtual const USHORT * GetWhichPairs() const; + virtual bool GetItemPropertyName( USHORT nWhichId, ::rtl::OUString & rOutName ) const; + + virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const; + virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet ) const; + +private: + ::std::vector< ItemConverter * > m_aConverters; + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XAxis > m_xAxis; + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > + m_xCoordinateSystem; + sal_Int32 m_nDimension; + NumberFormatterWrapper * m_pNumberFormatterWrapper; + + ::drafts::com::sun::star::chart2::ExplicitScaleData * m_pExplicitScale; + ::drafts::com::sun::star::chart2::ExplicitIncrementData * m_pExplicitIncrement; + double * m_pExplicitOrigin; +}; + +} // namespace wrapper +} // namespace chart + +// CHART_AXISITEMCONVERTER_HXX +#endif diff --git a/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx b/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx new file mode 100644 index 000000000000..861af79ce0b6 --- /dev/null +++ b/chart2/source/controller/inc/CharacterPropertyItemConverter.hxx @@ -0,0 +1,100 @@ +/************************************************************************* + * + * $RCSfile: CharacterPropertyItemConverter.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_CHARACTERPROPERTYITEMCONVERTER_HXX +#define CHART_CHARACTERPROPERTYITEMCONVERTER_HXX + +#include "ItemConverter.hxx" + +#ifndef _COM_SUN_STAR_UNO_ANY_HXX_ +#include <com/sun/star/uno/Any.hxx> +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATE_HPP_ +#include <com/sun/star/beans/PropertyState.hpp> +#endif + +namespace chart +{ +namespace wrapper +{ + +class CharacterPropertyItemConverter : + public ItemConverter +{ +public: + CharacterPropertyItemConverter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropertySet, + SfxItemPool& rItemPool ); + virtual ~CharacterPropertyItemConverter(); + +protected: + virtual const USHORT * GetWhichPairs() const; + virtual bool GetItemPropertyName( USHORT nWhichId, ::rtl::OUString & rOutName ) const; + + virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const; + virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet ) const; +}; + +} // namespace wrapper +} // namespace chart + +// CHART_CHARACTERPROPERTYITEMCONVERTER_HXX +#endif diff --git a/chart2/source/controller/inc/DataPointItemConverter.hxx b/chart2/source/controller/inc/DataPointItemConverter.hxx new file mode 100644 index 000000000000..3853bda018d4 --- /dev/null +++ b/chart2/source/controller/inc/DataPointItemConverter.hxx @@ -0,0 +1,110 @@ +/************************************************************************* + * + * $RCSfile: DataPointItemConverter.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_DATAPOINTITEMCONVERTER_HXX +#define CHART_DATAPOINTITEMCONVERTER_HXX + +#include "ItemConverter.hxx" +#include "GraphicPropertyItemConverter.hxx" +#include "chartview/NumberFormatterWrapper.hxx" + +#include <vector> + +class SdrModel; + +namespace chart +{ +namespace wrapper +{ + +class DataPointItemConverter : + public ItemConverter +{ +public: + DataPointItemConverter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropertySet, + SfxItemPool& rItemPool, + SdrModel& rDrawModel, + NumberFormatterWrapper * pNumFormatter, + GraphicPropertyItemConverter::eGraphicObjectType eMapTo = + GraphicPropertyItemConverter::FILLED_DATA_POINT ); + virtual ~DataPointItemConverter(); + + virtual void FillItemSet( SfxItemSet & rOutItemSet ) const; + virtual bool ApplyItemSet( const SfxItemSet & rItemSet ); + +protected: + virtual const USHORT * GetWhichPairs() const; + virtual bool GetItemPropertyName( USHORT nWhichId, ::rtl::OUString & rOutName ) const; + + virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const; + virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet ) const; + +private: + ::std::vector< ItemConverter * > m_aConverters; + NumberFormatterWrapper * m_pNumberFormatterWrapper; +}; + +} // namespace wrapper +} // namespace chart + +// CHART_DATAPOINTITEMCONVERTER_HXX +#endif diff --git a/chart2/source/controller/inc/DrawViewWrapper.hxx b/chart2/source/controller/inc/DrawViewWrapper.hxx new file mode 100644 index 000000000000..bd59947f71f5 --- /dev/null +++ b/chart2/source/controller/inc/DrawViewWrapper.hxx @@ -0,0 +1,121 @@ +/************************************************************************* + * + * $RCSfile: DrawViewWrapper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_DRAW_VIEW_WRAPPER_HXX +#define _CHART2_DRAW_VIEW_WRAPPER_HXX + +#ifndef _E3D_VIEW3D_HXX +#include <svx/view3d.hxx> +#endif + +class SdrModel; + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** The DrawViewWrapper should help us to reduce effort if the underlying DrawingLayer changes. +Another task is to hide functionality we do not need, for example more than one page. +*/ + +class MarkHandleProvider +{ +public: + virtual bool getMarkHandles( SdrHdlList& rHdlList ) =0; + virtual bool getFrameDragSingles() =0; +}; + +class DrawViewWrapper : public E3dView +{ +public: + DrawViewWrapper(SdrModel* pModel, OutputDevice* pOut); + virtual ~DrawViewWrapper(); + + //fill list of selection handles 'aHdl' + virtual void SetMarkHandles(); + + //SdrPageView* GetPageView() { return m_pWrappedDLPageView; }; + + SdrObject* getHitObject( const Point& rPnt ) const; + //BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions, SdrObject** ppRootObj, ULONG* pnMarkNum=NULL, USHORT* pnPassNum=NULL) const; + //BOOL PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const; + //BOOL PickObj(const Point& rPnt, SdrObject*& rpObj, SdrPageView*& rpPV, ULONG nOptions=0) const { return PickObj(rPnt,nHitTolLog,rpObj,rpPV,nOptions); } + + //void MarkObj(SdrObject* pObj, SdrPageView* pPV, BOOL bUnmark=FALSE, BOOL bImpNoSetMarkHdl=FALSE); + void MarkObject( SdrObject* pObj ); + + //---------------------- + //pMarkHandleProvider can be NULL; ownership is not taken + void setMarkHandleProvider( MarkHandleProvider* pMarkHandleProvider ); + + void InitRedraw( OutputDevice* pOut, const Region& rReg ); + +private: + mutable SdrPageView* m_pWrappedDLPageView; + mutable MarkHandleProvider* m_pMarkHandleProvider; +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif + diff --git a/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx b/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx new file mode 100644 index 000000000000..2c068b4a0533 --- /dev/null +++ b/chart2/source/controller/inc/GraphicPropertyItemConverter.hxx @@ -0,0 +1,122 @@ +/************************************************************************* + * + * $RCSfile: GraphicPropertyItemConverter.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_GRAPHICPROPERTYITEMCONVERTER_HXX +#define CHART_GRAPHICPROPERTYITEMCONVERTER_HXX + +#include "ItemConverter.hxx" + +#ifndef _COM_SUN_STAR_UNO_ANY_HXX_ +#include <com/sun/star/uno/Any.hxx> +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATE_HPP_ +#include <com/sun/star/beans/PropertyState.hpp> +#endif + +class SdrModel; + +namespace chart +{ +namespace wrapper +{ + +class GraphicPropertyItemConverter : + public ItemConverter +{ +public: + enum eGraphicObjectType + { + FILLED_DATA_POINT, + LINE_DATA_POINT, + LINE_PROPERTIES, + FILL_PROPERTIES, + LINE_AND_FILL_PROPERTIES + }; + + GraphicPropertyItemConverter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropertySet, + SfxItemPool& rItemPool, + SdrModel& rDrawModel, + eGraphicObjectType eObjectType = FILLED_DATA_POINT ); + virtual ~GraphicPropertyItemConverter(); + +protected: + virtual const USHORT * GetWhichPairs() const; + virtual bool GetItemPropertyName( USHORT nWhichId, ::rtl::OUString & rOutName ) const; + + virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const; + virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet ) const; + + void FillBitmapItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const + throw( ::com::sun::star::beans::UnknownPropertyException ); + void ApplyBitmapItem( USHORT nWhichId, const SfxItemSet & rItemSet ) const + throw( ::com::sun::star::beans::UnknownPropertyException ); + +private: + eGraphicObjectType m_eGraphicObjectType; + SdrModel & m_rDrawModel; +}; + +} // namespace wrapper +} // namespace chart + +// CHART_GRAPHICPROPERTYITEMCONVERTER_HXX +#endif diff --git a/chart2/source/controller/inc/HelpIds.hrc b/chart2/source/controller/inc/HelpIds.hrc new file mode 100644 index 000000000000..69631b28fe74 --- /dev/null +++ b/chart2/source/controller/inc/HelpIds.hrc @@ -0,0 +1,142 @@ +/************************************************************************* + * + * $RCSfile: HelpIds.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_HELPIDS_HRC +#define CHART_HELPIDS_HRC + +#include <svtools/solar.hrc> + +//see old chart: schhids.h + +/* +#define HID_SCH_DATA_ROW (HID_SCH_START + 0) +#define HID_SCH_DATA_LINE (HID_SCH_START + 1) +#define HID_SCH_DATA_POINT (HID_SCH_START + 2) +#define HID_SCH_DIAGRAM_X_AXIS (HID_SCH_START + 3) +*/ +#define HID_SCH_ALIGNMENT (HID_SCH_START + 4) +#define HID_SCH_LEGEND_POS (HID_SCH_START + 5) +#define HID_SCH_DATA_DESCR (HID_SCH_START + 6) + +#define HID_SCH_SCALE_Y (HID_SCH_START + 7) + +#define HID_SCH_STAT (HID_SCH_START + 8) +/* +#define HID_SCH_WIN_DOCUMENT (HID_SCH_START + 9) +#define HID_SCH_CTL_DATA (HID_SCH_START + 10) +*/ +#define HID_SCH_CT_INDICATE (HID_SCH_START + 11) +#define HID_SCH_CT_REGRESS (HID_SCH_START + 12) +/* +#define HID_SCH_CT_1_CHARTTYPE (HID_SCH_START + 13) +#define HID_SCH_CT_2_CHARTVARIANT (HID_SCH_START + 14) +*/ +//for chart type dialog: +#define HID_SCH_CTL_TYPE (HID_SCH_START + 15) +#define HID_SCH_CTL_VARIANT (HID_SCH_START + 16) +#define HID_SCH_NUM_OF_LINES (HID_SCH_START + 43) +// +/* +#define HID_SCH_CTL_LIGHT (HID_SCH_START + 17) +*/ +#define HID_SCH_CT_INDICATE2 (HID_SCH_START + 18) +#define HID_SCH_CT_REGRESS2 (HID_SCH_START + 19) +/* +#define HID_SCH_TBI_EDIT_CANCEL (HID_SCH_START + 20) +#define HID_SCH_TBI_EDIT_ACCEPT (HID_SCH_START + 21) +#define HID_SCH_TBI_DATA_TRANSFER (HID_SCH_START + 22) +#define HID_SCH_TBI_DATA_INSERT_ROW (HID_SCH_START + 23) +#define HID_SCH_TBI_DATA_INSERT_COL (HID_SCH_START + 24) +#define HID_SCH_TBI_DATA_DELETE_ROW (HID_SCH_START + 25) +#define HID_SCH_TBI_DATA_DELETE_COL (HID_SCH_START + 26) +#define HID_SCH_TBI_DATA_SWAP_COL (HID_SCH_START + 27) +#define HID_SCH_TBI_DATA_SWAP_ROW (HID_SCH_START + 28) +#define HID_SCH_TBI_DATA_SORT_ROW (HID_SCH_START + 29) +#define HID_SCH_TBI_DATA_SORT_COL (HID_SCH_START + 30) +#define HID_SCH_TBI_DATA_SORT_TABLE_ROW (HID_SCH_START + 31) +#define HID_SCH_TBI_DATA_SORT_TABLE_COL (HID_SCH_START + 32) + +#define HID_SCH_TBX_EDIT (HID_SCH_START + 33) +#define HID_SCH_TBX_DATA (HID_SCH_START + 34) +*/ + +#define HID_SCH_ALIGNMENT_CTR_DIAL (HID_SCH_START + 35) +#define HID_SCH_ALIGNMENT_STACKED (HID_SCH_START + 36) +#define HID_SCH_ALIGNMENT_DEGREES (HID_SCH_START + 37) +/* +#define HID_SCH_LAYOUT (HID_SCH_START + 38) + +#define HID_SCH_TBX_EDIT_FIELD (HID_SCH_START + 39) +#define HID_SCH_DIAGRAM_Y_AXIS (HID_SCH_START + 40)//war mal 3 + +#define HID_SCH_DEF_COLOR (HID_SCH_START + 41) +*/ +#define HID_SCH_TP_AXIS_LABEL (HID_SCH_START + 42) + +#define HID_SCH_CHART_AUTO_FORMAT (HID_SCH_START + 44) + +// HID_SCH_START should be 63280 (checked 25.Nov 2002) + +// 453 == SCH_IF_CHARTVIEWSHELL, da SFX_INTERFACE_LIB kein +// Define sondern neuerdings ein Enum ist +//#define HID_SCH_VIEWSHELL_DOCUMENT (453) + + +#endif diff --git a/chart2/source/controller/inc/ItemConverter.hxx b/chart2/source/controller/inc/ItemConverter.hxx new file mode 100644 index 000000000000..e7176feeb153 --- /dev/null +++ b/chart2/source/controller/inc/ItemConverter.hxx @@ -0,0 +1,235 @@ +/************************************************************************* + * + * $RCSfile: ItemConverter.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_ITEMCONVERTER_HXX +#define CHART_ITEMCONVERTER_HXX + +#ifndef _CPPUHELPER_IMPLBASE1_HXX_ +#include <cppuhelper/implbase1.hxx> +#endif + +#ifndef _SFXITEMPOOL_HXX +#include <svtools/itempool.hxx> +#endif +#ifndef _SFXITEMSET_HXX +#include <svtools/itemset.hxx> +#endif +// #ifndef _SVX_UNOIPSET_HXX_ +// #include <svx/unoipset.hxx> +// #endif + +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XEVENTLISTENER_HPP_ +#include <com/sun/star/lang/XEventListener.hpp> +#endif + +class SfxItemPropertyMap; + +namespace chart +{ +namespace wrapper +{ + +/** This class serves for conversion between properties of an XPropertySet and + SfxItems in SfxItemSets. + + <p>With this helper classes, you can feed dialogs with XPropertySets and let + those modify by the dialogs.</p> + + <p>You must implement GetWhichPairs() such that an SfxItemSet created with + CreateEmptyItemSet() is able to hold all items that may be mapped.</p> + + <p>You also have to implement GetItemPropertyName(), in order to return the + property name for a given which-id.</p> + + <p>FillSpecialItem and ApplySpecialItem may be used for special handling of + individual item, e.g. if you need member-ids in QueryValue/PutValue</p> + */ +class ItemConverter : + public ::cppu::WeakImplHelper1< + ::com::sun::star::lang::XEventListener + > +{ +public: + /** Construct an item converter that uses the given property set for + reading/writing converted items + */ + ItemConverter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropertySet , + SfxItemPool& rItemPool ); + virtual ~ItemConverter(); + + /** applies all properties that can be mapped to items into the given item + set. + + <p>Call this method before opening a dialog.</p> + + @param rOutItemSet the SfxItemSet is filled with all items that are a + result of a conversion from a property of the internal + XPropertySet. + */ + virtual void FillItemSet( SfxItemSet & rOutItemSet ) const; + + /** applies all properties that are results of a conversion from all items + in rItemSet to the internal XPropertySet. + + <p>Call this method after a dialog was closed with OK</p> + + @return true, if any properties have been changed, false otherwise. + */ + virtual bool ApplyItemSet( const SfxItemSet & rItemSet ); + + /** creates an empty item set using the given pool + or a common pool if empty (see GetItemPool) and + allowing all items given in the ranges returned by GetWhichPairs. + */ + SfxItemSet CreateEmptyItemSet() const; + + /** States whether conversion is still likely to work. + + <p>In particular, it is checked if the XPropertySet given in the CTOR is + still valid, i.e. not disposed. It is assumed that the XPropertySet is + valid when the converter is constructed.</p> + + <p>This only works if the XPropertySet given in the CTOR supports the + interface ::com::sun::star::lang::XComponent.</p> + */ + bool IsValid() const; + + /// creates a pure chart item pool + static SfxItemPool* CreateSchItemPool(); + + static void InvalidateUnequalItems( SfxItemSet &rDestSet, const SfxItemSet &rSourceSet ); + +protected: + // ________ + + /** implement this method to provide an array of which-ranges of the form: + + <pre> + const USHORT aMyPairs[] = + { + from_1, to_1, + from_2, to_2, + ... + from_n, to_n, + 0 + }; + </pre> + */ + virtual const USHORT * GetWhichPairs() const = 0; + + /** implement this method to return a Property object for a given which id. + + @param rOutName If </TRUE> is returned, this contains the property name. + + @return </TRUE>, if the item can be mapped to a property. + */ + virtual bool GetItemPropertyName( USHORT nWhichId, ::rtl::OUString & rOutName ) const; + + /** for items that can not be mapped directly to a property. + + This method is called from FillItemSet(), if GetItemPropertyName() returns + false. + */ + virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const; + + /** for items that can not be mapped directly to a property. + + This method is called from ApplyItemSet(), if GetItemPropertyName() returns + false. + + @return </TRUE> if the item changed a property, </FALSE> otherwise. + */ + virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet ) const; + + // ________ + + /// Returns the pool + SfxItemPool & GetItemPool() const; + + /** Returns the XPropertySet that was given in the CTOR and is used to apply + items in ApplyItemSet(). + */ + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > GetPropertySet() const; + + // ____ XEventListener ____ + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) + throw (::com::sun::star::uno::RuntimeException); + +private: + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > m_xPropertySet; + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo > m_xPropertySetInfo; + + SfxItemPool& m_rItemPool; + bool m_bIsValid; +}; + +} // namespace wrapper +} // namespace chart + +// CHART_ITEMCONVERTER_HXX +#endif diff --git a/chart2/source/controller/inc/ItemPropertyMap.hxx b/chart2/source/controller/inc/ItemPropertyMap.hxx new file mode 100644 index 000000000000..7fb51e46fe2b --- /dev/null +++ b/chart2/source/controller/inc/ItemPropertyMap.hxx @@ -0,0 +1,119 @@ +/************************************************************************* + * + * $RCSfile: ItemPropertyMap.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_ITEMPROPERTYMAP_HXX +#define CHART_ITEMPROPERTYMAP_HXX + +#include "InlineContainer.hxx" + +namespace chart +{ +namespace wrapper +{ + +typedef ::std::map< USHORT, ::rtl::OUString > ItemPropertyMapType; +typedef ::comphelper::MakeMap< USHORT, ::rtl::OUString > MakeItemPropertyMap; + +class FillItemSetFunc : public ::std::unary_function< void, ItemConverter * > +{ +public: + explicit FillItemSetFunc( SfxItemSet & rOutItemSet ) : + m_rOutItemSet( rOutItemSet ) + {} + + void operator() ( ItemConverter * pConv ) + { + pConv->FillItemSet( m_rOutItemSet ); + } + +private: + SfxItemSet & m_rOutItemSet; +}; + +class ApplyItemSetFunc : public ::std::unary_function< void, ItemConverter * > +{ +public: + explicit ApplyItemSetFunc( const SfxItemSet & rItemSet, + bool & rOutResult ) : + m_rItemSet( rItemSet ), + m_rOutResult( rOutResult ) + {} + + void operator() ( ItemConverter * pConv ) + { + m_rOutResult = pConv->ApplyItemSet( m_rItemSet ) || m_rOutResult; + } + +private: + const SfxItemSet & m_rItemSet; + bool & m_rOutResult; +}; + +struct DeleteItemConverterPtr : public ::std::unary_function< void, ItemConverter * > +{ + void operator() ( ItemConverter * pConv ) + { delete pConv; } +}; + +} // namespace wrapper +} // namespace chart + +// CHART_ITEMPROPERTYMAP_HXX +#endif diff --git a/chart2/source/controller/inc/MultipleItemConverter.hxx b/chart2/source/controller/inc/MultipleItemConverter.hxx new file mode 100644 index 000000000000..8284a0254802 --- /dev/null +++ b/chart2/source/controller/inc/MultipleItemConverter.hxx @@ -0,0 +1,138 @@ +/************************************************************************* + * + * $RCSfile: MultipleItemConverter.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_ALLAXISITEMCONVERTER_HXX +#define CHART_ALLAXISITEMCONVERTER_HXX + +#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_ +#include <com/sun/star/frame/XModel.hpp> +#endif + +#include "ItemConverter.hxx" + +#include <vector> + +class SdrModel; + +namespace chart +{ +namespace wrapper +{ + +class MultipleItemConverter : public ItemConverter +{ +public: + virtual ~MultipleItemConverter(); + + virtual void FillItemSet( SfxItemSet & rOutItemSet ) const; + virtual bool ApplyItemSet( const SfxItemSet & rItemSet ); + +protected: + MultipleItemConverter( SfxItemPool& rItemPool ); + + ::std::vector< ItemConverter * > m_aConverters; +}; + +class AllAxisItemConverter : public MultipleItemConverter +{ +public: + AllAxisItemConverter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > & xChartModel, + SfxItemPool& rItemPool, + SdrModel& rDrawModel ); + virtual ~AllAxisItemConverter(); + +protected: + virtual const USHORT * GetWhichPairs() const; +}; + +class AllGridItemConverter : public MultipleItemConverter +{ +public: + AllGridItemConverter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > & xChartModel, + SfxItemPool& rItemPool, + SdrModel& rDrawModel ); + virtual ~AllGridItemConverter(); + +protected: + virtual const USHORT * GetWhichPairs() const; +}; + +class AllDataLabelItemConverter : public MultipleItemConverter +{ +public: + AllDataLabelItemConverter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > & xChartModel, + SfxItemPool& rItemPool, + SdrModel& rDrawModel ); + virtual ~AllDataLabelItemConverter(); + +protected: + virtual const USHORT * GetWhichPairs() const; +}; + +} // namespace wrapper +} // namespace chart + +#endif diff --git a/chart2/source/controller/inc/SchSlotIds.hxx b/chart2/source/controller/inc/SchSlotIds.hxx new file mode 100644 index 000000000000..fce3f23da6bd --- /dev/null +++ b/chart2/source/controller/inc/SchSlotIds.hxx @@ -0,0 +1,183 @@ +/************************************************************************* + * + * $RCSfile: SchSlotIds.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef SCH_SLOTIDS_HXX +#define SCH_SLOTIDS_HXX + +// header for SID_OBJ1_START +#ifndef _SFXSIDS_HRC +#include <sfx2/sfxsids.hrc> +#endif + +// SID_OBJ1_START == 30000 + 512 +#define SID_COPYFORMAT SID_OBJ1_START + +#define SID_PASTEFORMAT (SID_OBJ1_START + 1) +#define SID_DIAGRAM_DATA (SID_OBJ1_START + 2) +#define SID_INSERT_TITLE (SID_OBJ1_START + 3) +#define SID_INSERT_CHART_LEGEND (SID_OBJ1_START + 4) +#define SID_INSERT_DESCRIPTION (SID_OBJ1_START + 5) +#define SID_INSERT_AXIS (SID_OBJ1_START + 6) +#define SID_DATA_ROW_POINT (SID_OBJ1_START + 7) +#define SID_CHART_TITLE (SID_OBJ1_START + 8) +#define SID_LEGEND (SID_OBJ1_START + 9) +#define SID_DIAGRAM_AXIS (SID_OBJ1_START + 10) +#define SID_DIAGRAM_GRID (SID_OBJ1_START + 11) +#define SID_DIAGRAM_WALL (SID_OBJ1_START + 12) +#define SID_DIAGRAM_FLOOR (SID_OBJ1_START + 13) +#define SID_DIAGRAM_AREA (SID_OBJ1_START + 14) +#define SID_3D_VIEW (SID_OBJ1_START + 15) +#define SID_DIAGRAM_TYPE (SID_OBJ1_START + 16) +#define SID_TOGGLE_TITLE (SID_OBJ1_START + 17) +#define SID_TOGGLE_LEGEND (SID_OBJ1_START + 18) +#define SID_TOGGLE_AXIS_TITLE (SID_OBJ1_START + 19) +#define SID_TOGGLE_AXIS_DESCR (SID_OBJ1_START + 20) // 30532 +#define SID_TOGGLE_GRID_HORZ (SID_OBJ1_START + 21) +#define SID_TOGGLE_GRID_VERT (SID_OBJ1_START + 22) +#define SID_DATA_IN_ROWS (SID_OBJ1_START + 23) +#define SID_DATA_IN_COLUMNS (SID_OBJ1_START + 24) +#define SID_TOOL_SELECT (SID_OBJ1_START + 25) +#define SID_CONTEXT_TYPE (SID_OBJ1_START + 26) +#define SID_NEW_ARRANGEMENT (SID_OBJ1_START + 27) // 30539 +#define SID_INSERT_GRIDS (SID_OBJ1_START + 28) + +#define SID_MAINTITLE (SID_OBJ1_START + 29) +#define SID_SUBTITLE (SID_OBJ1_START + 30) +#define SID_XAXIS_TITLE (SID_OBJ1_START + 31) +#define SID_YAXIS_TITLE (SID_OBJ1_START + 32) +#define SID_ZAXIS_TITLE (SID_OBJ1_START + 33) + +#ifdef SID_UPDATE +#undef SID_UPDATE +#endif +#define SID_UPDATE (SID_OBJ1_START + 34) + +// DataCollection +#define SID_DATA (SID_OBJ1_START + 35) +#define SID_ADD_COLUMN (SID_OBJ1_START + 36) +#define SID_ADD_ROW (SID_OBJ1_START + 37) + +#define SID_DIAGRAM_AXIS_X (SID_OBJ1_START + 40) +#define SID_DIAGRAM_AXIS_Y (SID_OBJ1_START + 41) +#define SID_DIAGRAM_AXIS_Z (SID_OBJ1_START + 42) +#define SID_DIAGRAM_AXIS_ALL (SID_OBJ1_START + 43) +#define SID_INSERT_STATISTICS (SID_OBJ1_START + 44) +#define SID_DIAGRAM_TITLE_MAIN (SID_OBJ1_START + 45) +#define SID_DIAGRAM_TITLE_SUB (SID_OBJ1_START + 46) +#define SID_DIAGRAM_TITLE_X (SID_OBJ1_START + 47) +#define SID_DIAGRAM_TITLE_Y (SID_OBJ1_START + 48) +#define SID_DIAGRAM_TITLE_Z (SID_OBJ1_START + 49) +#define SID_DIAGRAM_TITLE_ALL (SID_OBJ1_START + 50) +#define SID_DIAGRAM_GRID_Y_MAIN (SID_OBJ1_START + 51) +#define SID_DIAGRAM_GRID_X_MAIN (SID_OBJ1_START + 52) +#define SID_DIAGRAM_GRID_Z_MAIN (SID_OBJ1_START + 53) +#define SID_DIAGRAM_GRID_ALL (SID_OBJ1_START + 54) + +#define SID_HAS_X_DESCR (SID_OBJ1_START + 55) +#define SID_HAS_Y_DESCR (SID_OBJ1_START + 56) +#define SID_HAS_Z_DESCR (SID_OBJ1_START + 57) + +#define SID_DIAGRAM_OBJECTS (SID_OBJ1_START + 60) + +#define SID_HAS_X_TITLE (SID_OBJ1_START + 61) +#define SID_HAS_Y_TITLE (SID_OBJ1_START + 62) +#define SID_HAS_Z_TITLE (SID_OBJ1_START + 63) +#define SID_HAS_MAIN_TITLE (SID_OBJ1_START + 64) +#define SID_HAS_SUB_TITLE (SID_OBJ1_START + 65) + +#define SID_DIAGRAM_GRID_Y_HELP (SID_OBJ1_START + 66) +#define SID_DIAGRAM_GRID_X_HELP (SID_OBJ1_START + 67) +#define SID_DIAGRAM_GRID_Z_HELP (SID_OBJ1_START + 68) + +#define SID_DIAGRAM_DATA_WIN (SID_OBJ1_START + 70) + +#define SID_DIAGRAM_ERROR (SID_OBJ1_START + 71) +#define SID_DIAGRAM_AVERAGEVALUE (SID_OBJ1_START + 72) +#define SID_DIAGRAM_REGRESSION (SID_OBJ1_START + 73) +#define SID_SCALE_TEXT (SID_OBJ1_START + 74) +#define SID_TEXTBREAK (SID_OBJ1_START + 75) + +#define SID_DIAGRAM_DATADESCRIPTION (SID_OBJ1_START + 76) +#define SID_DIAGRAM_POSLEGEND (SID_OBJ1_START + 77) +#define SID_DIAGRAM_DEFAULTCOLORS (SID_OBJ1_START + 78) +#define SID_DIAGRAM_BARWIDTH (SID_OBJ1_START + 79) +#define SID_DIAGRAM_NUMLINES (SID_OBJ1_START + 80) + + +#define SID_ROW_POSITION (SID_OBJ1_START + 81) +#define SID_ROW_MOREFRONT (SID_OBJ1_START + 82) +#define SID_ROW_MOREBACK (SID_OBJ1_START + 83) + +// Title-Object +#define SID_TITLE_TEXT (SID_OBJ1_START + 100) + +#define SID_DIAGRAM_STOCK_LINE (SID_OBJ1_START + 101) +#define SID_DIAGRAM_STOCK_LOSS (SID_OBJ1_START + 102) +#define SID_DIAGRAM_STOCK_PLUS (SID_OBJ1_START + 103) + + +#define SID_DIAGRAM_AXIS_A (SID_OBJ1_START + 104) +#define SID_DIAGRAM_AXIS_B (SID_OBJ1_START + 105) +#define SID_DIAGRAM_AXIS_C (SID_OBJ1_START + 106) + +// Reserved till (SID_OBJ1_START + 110) + +#endif +// SCH_SLOTIDS_HXX diff --git a/chart2/source/controller/inc/TitleItemConverter.hxx b/chart2/source/controller/inc/TitleItemConverter.hxx new file mode 100644 index 000000000000..1168d3290dbf --- /dev/null +++ b/chart2/source/controller/inc/TitleItemConverter.hxx @@ -0,0 +1,104 @@ +/************************************************************************* + * + * $RCSfile: TitleItemConverter.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_TITLEITEMCONVERTER_HXX +#define CHART_TITLEITEMCONVERTER_HXX + +#include "ItemConverter.hxx" + +#include <vector> + +class SdrModel; + +namespace chart +{ +namespace wrapper +{ + +class TitleItemConverter : + public ItemConverter +{ +public: + TitleItemConverter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropertySet, + SfxItemPool& rItemPool, + SdrModel& rDrawModel ); + virtual ~TitleItemConverter(); + + virtual void FillItemSet( SfxItemSet & rOutItemSet ) const; + virtual bool ApplyItemSet( const SfxItemSet & rItemSet ); + +protected: + virtual const USHORT * GetWhichPairs() const; + virtual bool GetItemPropertyName( USHORT nWhichId, ::rtl::OUString & rOutName ) const; + + virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const; + virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet ) const; + +private: + ::std::vector< ItemConverter * > m_aConverters; +}; + +} // namespace wrapper +} // namespace chart + +// CHART_TITLEITEMCONVERTER_HXX +#endif diff --git a/chart2/source/controller/inc/ViewElementListProvider.hxx b/chart2/source/controller/inc/ViewElementListProvider.hxx new file mode 100644 index 000000000000..ccea24ce61d3 --- /dev/null +++ b/chart2/source/controller/inc/ViewElementListProvider.hxx @@ -0,0 +1,129 @@ +/************************************************************************* + * + * $RCSfile: ViewElementListProvider.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_VIEWELEMENTLISTPROVIDER_HXX +#define _CHART2_VIEWELEMENTLISTPROVIDER_HXX + +#ifndef _XTABLE_HXX +#include <svx/xtable.hxx> +#endif +#ifndef _SVDPAGE_HXX +#include <svx/svdpage.hxx> +#endif + +class FontList; +class SvNumberFormatter; + +//............................................................................. +namespace chart +{ +//............................................................................. + +class DrawModelWrapper; +class NumberFormatterWrapper; + +class ViewElementListProvider +{ +public: + ViewElementListProvider( DrawModelWrapper* pDrawModelWrapper, NumberFormatterWrapper* pNumberFormatterWrapper ); + virtual ~ViewElementListProvider(); + + XColorTable* GetColorTable() const;//from class SdrModel + XDashList* GetDashList() const;//from class SdrModel + XLineEndList* GetLineEndList() const;//from class SdrModel + XGradientList* GetGradientList() const;//from class SdrModel + XHatchList* GetHatchList() const;//from class SdrModel + XBitmapList* GetBitmapList() const;//from class SdrModel + + //create chartspecific symbols for linecharts + SdrObjList* GetSymbolList() const;// in old chart called GetSdrObjList + + FontList* getFontList() const; + //SfxPrinter* getPrinter(); + + //infrastructure + /** introduced for #101318#: + + The chart-internal number formatter is necessary to render values for + the UI with a higher standard precision than the one you might get + externally (from Calc). As you should not modify the precision of an + external number formatter, this one comes in handy. + + Note that for the dialog only the standard format is used, i.e., any + user-defined formats that are only available in the external formatter + are not required here. + + This method is used by SchAttribTabDlg::PageCreated (attrib.cxx) + + @returns the chart internal number formatter + */ + SvNumberFormatter * GetOwnNumberFormatter() const; + SvNumberFormatter * GetNumFormatter() const; + +private: + DrawModelWrapper* m_pDrawModelWrapper; + mutable FontList* m_pFontList; + mutable NumberFormatterWrapper* m_pNumberFormatterWrapper; +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/controller/inc/dlg_ChartType.hxx b/chart2/source/controller/inc/dlg_ChartType.hxx new file mode 100644 index 000000000000..b5b047cb02ec --- /dev/null +++ b/chart2/source/controller/inc/dlg_ChartType.hxx @@ -0,0 +1,209 @@ +/************************************************************************* + * + * $RCSfile: dlg_ChartType.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_DLG_CHARTTYPE_HXX +#define _CHART2_DLG_CHARTTYPE_HXX + +/* +#ifndef _SCH_DIAGRTYP_HXX_ +#define _SCH_DIAGRTYP_HXX_ + +#ifndef _SV_BUTTON_HXX //autogen +#include <vcl/button.hxx> +#endif +#ifndef _SV_FIXED_HXX //autogen +#include <vcl/fixed.hxx> +#endif +#ifndef _SV_FIELD_HXX //autogen +#include <vcl/field.hxx> +#endif +#ifndef _VALUESET_HXX //autogen +#include <svtools/valueset.hxx> +#endif +#ifndef _SV_DIALOG_HXX //autogen +#include <vcl/dialog.hxx> +#endif +#ifndef _SFXITEMSET_HXX //autogen +#include <svtools/itemset.hxx> +#endif +*/ + +// header for class ModalDialog +#ifndef _SV_DIALOG_HXX +#include <vcl/dialog.hxx> +#endif +// header for class RadioButton +#ifndef _SV_BUTTON_HXX +#include <vcl/button.hxx> +#endif +// header for class FixedLine +#ifndef _SV_FIXED_HXX +#include <vcl/fixed.hxx> +#endif +// header for class MetricField +#ifndef _SV_FIELD_HXX +#include <vcl/field.hxx> +#endif +// header for class ValueSet +#ifndef _VALUESET_HXX +#include <svtools/valueset.hxx> +#endif +// header for class SfxItemSet +#ifndef _SFXITEMSET_HXX +#include <svtools/itemset.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +enum ChartDimension +{ + CHDIM_2D, + CHDIM_3D +}; + +#define CHDIM_COUNT (CHDIM_3D + 1) + +/************************************************************************* +|* +|* Dialog zur Auswahl eines Diagrammtyps +|* +\************************************************************************/ +class SchDiagramTypeDlg : public ModalDialog +{ +private: + long n3DGeometry; + RadioButton aRbt2D; + RadioButton aRbt3D; + FixedLine aFlDimension; + FixedText aFtDeep; + MetricField aMtrFldDeep; + FixedText aFtGran; + MetricField aMtrFldGran; + FixedText aFtNumLines; + MetricField aMtrFldNumLines; + + FixedText aFtType; + ValueSet aCtlType; + FixedText aFtVariant; + ValueSet aCtlVariant; + OKButton aBtnOK; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + ChartDimension eDimension; + + const SfxItemSet& rOutAttrs; + + void Reset(); + + void FillTypeSet(ChartDimension eDim, bool bForce=false); + void FillVariantSet(USHORT nType); + + DECL_LINK(SelectDimensionHdl, void*); + DECL_LINK(SelectTypeHdl, void*); + DECL_LINK(DoubleClickHdl, void*); + DECL_LINK(ClickHdl, void*); + + void SwitchDepth (USHORT nID); + + /** Hides/Shows the controls for line/bar combination chart according to the + chart type id given as nID. + */ + void SwitchNumLines( USHORT nID ); + + void FillValueSets(); + +public: + SchDiagramTypeDlg(Window* pWindow, const SfxItemSet& rInAttrs); + virtual ~SchDiagramTypeDlg(); + + void GetAttr(SfxItemSet& rOutAttrs); +// int GetDepth(); +// void SetDepth( int nDeep ); + +// int GetGranularity(); +// void SetGranularity( int nGranularity ); + + /** The value set here determines the maximum number of lines in a line/bar + combination chart. This should usually be one less than the number of + series, such that at least one series remains a bar. + */ + void SetMaximumNumberOfLines( long nMaxLines ); + /** set the current number of lines that are used in a line/bar combination + chart. + */ +// void SetNumberOfLines( long nLines ); + /** get the number of lines that should be used for a line/bar combination + chart. This has to be set before to be meaningful + */ +// long GetNumberOfLines() const; + + virtual void DataChanged( const DataChangedEvent& rDCEvt ); +}; + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif + + diff --git a/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx b/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx new file mode 100644 index 000000000000..b7dcbbff3509 --- /dev/null +++ b/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx @@ -0,0 +1,142 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertAxis_Grid.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_DLG_INSERT_AXIS_GRID_HXX +#define _CHART2_DLG_INSERT_AXIS_GRID_HXX + +// header for class ModalDialog +#ifndef _SV_DIALOG_HXX +#include <vcl/dialog.hxx> +#endif +// header for class FixedLine +#ifndef _SV_FIXED_HXX +#include <vcl/fixed.hxx> +#endif +// header for class CheckBox +#ifndef _SV_BUTTON_HXX +#include <vcl/button.hxx> +#endif + +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ +#include <com/sun/star/uno/Sequence.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +struct InsertMeterDialogData +{ + ::com::sun::star::uno::Sequence< sal_Bool > aPossibilityList; + ::com::sun::star::uno::Sequence< sal_Bool > aExistenceList; + + InsertMeterDialogData(); +}; + +/************************************************************************* +|* +|* insert Axis dialog (also base for grid dialog) +|* +\************************************************************************/ +class SchAxisDlg : public ModalDialog +{ +protected: + FixedLine aFlPrimary; + FixedLine aFlPrimaryGrid; + CheckBox aCbPrimaryX; + CheckBox aCbPrimaryY; + CheckBox aCbPrimaryZ; + + FixedLine aFlSecondary; + FixedLine aFlSecondaryGrid; + CheckBox aCbSecondaryX; + CheckBox aCbSecondaryY; + CheckBox aCbSecondaryZ; + + OKButton aPbOK; + CancelButton aPbCancel; + HelpButton aPbHelp; + +public: + SchAxisDlg( Window* pParent, const InsertMeterDialogData& rInput, BOOL bAxisDlg=true ); + virtual ~SchAxisDlg(); + + void getResult( InsertMeterDialogData& rOutput ); +}; + + +/************************************************************************* +|* +|* Grid dialog +|* +\************************************************************************/ +class SchGridDlg : public SchAxisDlg +{ +public: + SchGridDlg( Window* pParent, const InsertMeterDialogData& rInput ); + virtual ~SchGridDlg(); +}; + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif diff --git a/chart2/source/controller/inc/dlg_InsertDataLabel.hxx b/chart2/source/controller/inc/dlg_InsertDataLabel.hxx new file mode 100644 index 000000000000..6de5f95e6677 --- /dev/null +++ b/chart2/source/controller/inc/dlg_InsertDataLabel.hxx @@ -0,0 +1,122 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertDataLabel.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_DLG_INSERT_DATALABELS_GRID_HXX +#define _CHART2_DLG_INSERT_DATALABELS_GRID_HXX + +// header for class ModalDialog +#ifndef _SV_DIALOG_HXX +#include <vcl/dialog.hxx> +#endif +// header for class FixedLine +#ifndef _SV_FIXED_HXX +#include <vcl/fixed.hxx> +#endif +// header for class CheckBox +#ifndef _SV_BUTTON_HXX +#include <vcl/button.hxx> +#endif +// header for class SfxItemSet +#ifndef _SFXITEMSET_HXX +#include <svtools/itemset.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +/************************************************************************* +|* +|* Datenbeschriftungen-Dialog +|* +\************************************************************************/ +class SchDataDescrDlg : public ModalDialog +{ +private: + CheckBox aCbValue; + RadioButton aRbNumber; + RadioButton aRbPercent; + CheckBox aCbText; + FixedLine aFlDescr; + CheckBox aCbSymbol; + OKButton aBtnOK; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + const SfxItemSet& rOutAttrs; + + DECL_LINK( EnableHdl, CheckBox * ); + + void Reset(); + +public: + SchDataDescrDlg(Window* pParent, const SfxItemSet& rInAttrs); + virtual ~SchDataDescrDlg(); + + void GetAttr(SfxItemSet& rOutAttrs); +}; + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif + diff --git a/chart2/source/controller/inc/dlg_InsertLegend.hxx b/chart2/source/controller/inc/dlg_InsertLegend.hxx new file mode 100644 index 000000000000..dcf7fca9f0a7 --- /dev/null +++ b/chart2/source/controller/inc/dlg_InsertLegend.hxx @@ -0,0 +1,122 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertLegend.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_DLG_INSERT_LEGEND_GRID_HXX +#define _CHART2_DLG_INSERT_LEGEND_GRID_HXX + +// header for class ModalDialog +#ifndef _SV_DIALOG_HXX +#include <vcl/dialog.hxx> +#endif +// header for class FixedLine +#ifndef _SV_FIXED_HXX +#include <vcl/fixed.hxx> +#endif +// header for class CheckBox +#ifndef _SV_BUTTON_HXX +#include <vcl/button.hxx> +#endif +// header for class SfxItemSet +#ifndef _SFXITEMSET_HXX +#include <svtools/itemset.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + + +/************************************************************************* +|* +|* Legenden-Dialog +|* +\************************************************************************/ +class SchLegendDlg : public ModalDialog +{ +private: + CheckBox aCbxShow; + RadioButton aRbtLeft; + RadioButton aRbtTop; + RadioButton aRbtRight; + RadioButton aRbtBottom; + FixedLine aFlLegend; + OKButton aBtnOK; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + const SfxItemSet& rOutAttrs; + + void Reset(); + DECL_LINK (CbxClick, CheckBox *); + +public: + SchLegendDlg(Window* pParent, const SfxItemSet& rInAttrs); + virtual ~SchLegendDlg(); + + void GetAttr(SfxItemSet& rOutAttrs); +}; + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif + diff --git a/chart2/source/controller/inc/dlg_InsertTitle.hxx b/chart2/source/controller/inc/dlg_InsertTitle.hxx new file mode 100644 index 000000000000..0ed7fe671daf --- /dev/null +++ b/chart2/source/controller/inc/dlg_InsertTitle.hxx @@ -0,0 +1,132 @@ +/************************************************************************* + * + * $RCSfile: dlg_InsertTitle.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_DLG_INSERT_TITLE_GRID_HXX +#define _CHART2_DLG_INSERT_TITLE_GRID_HXX + +// header for class ModalDialog +#ifndef _SV_DIALOG_HXX +#include <vcl/dialog.hxx> +#endif +// header for class Edit +#ifndef _SV_EDIT_HXX +#include <vcl/edit.hxx> +#endif +// header for class CheckBox +#ifndef _SV_BUTTON_HXX +#include <vcl/button.hxx> +#endif + +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ +#include <com/sun/star/uno/Sequence.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +struct InsertTitleDialogData +{ + ::com::sun::star::uno::Sequence< sal_Bool > aPossibilityList; + ::com::sun::star::uno::Sequence< sal_Bool > aExistenceList; + ::com::sun::star::uno::Sequence< rtl::OUString > aTextList; + + InsertTitleDialogData(); +}; + +/************************************************************************* +|* +|* Titel-Dialog +|* +\************************************************************************/ + +class SchTitleDlg : public ModalDialog +{ +private: + CheckBox aCbxMain; + Edit aEdtMain; + CheckBox aCbxSub; + Edit aEdtSub; + CheckBox aCbxXAxis; + Edit aEdtXAxis; + CheckBox aCbxYAxis; + Edit aEdtYAxis; + CheckBox aCbxZAxis; + Edit aEdtZAxis; + OKButton aBtnOK; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + DECL_LINK(EnableTitleHdl, CheckBox*); + +public: + SchTitleDlg( Window* pParent, const InsertTitleDialogData& rInput ); + virtual ~SchTitleDlg(); + + void getResult( InsertTitleDialogData& rOutput ); +}; + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif + diff --git a/chart2/source/controller/inc/dlg_ObjectProperties.hxx b/chart2/source/controller/inc/dlg_ObjectProperties.hxx new file mode 100644 index 000000000000..d1e0c4a7c3d0 --- /dev/null +++ b/chart2/source/controller/inc/dlg_ObjectProperties.hxx @@ -0,0 +1,196 @@ +/************************************************************************* + * + * $RCSfile: dlg_ObjectProperties.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:27 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_DLG_OBJECTPROPERTIES_HXX +#define _CHART2_DLG_OBJECTPROPERTIES_HXX + +#include "chartview/ObjectIdentifier.hxx" + +#ifndef _SFXTABDLG_HXX +#include <sfx2/tabdlg.hxx> +#endif +// header for typedef ChangeType +#ifndef _SVX_TAB_AREA_HXX +#include <svx/tabarea.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + + /* +enum AttrType +{ + ATTR_TITLE, + ATTR_LEGEND, + ATTR_DATA_ROW, + ATTR_DATA_LINE, + ATTR_DATA_POINT, + ATTR_AXIS, + ATTR_X_AXIS_2D, + ATTR_X_AXIS_3D, + ATTR_Y_AXIS_2D, + ATTR_Y_AXIS_3D, + ATTR_Z_AXIS, + ATTR_GRID, + ATTR_DIAGRAM_AREA, + ATTR_DIAGRAM_WALL, + ATTR_DIAGRAM_FLOOR, + ATTR_LINE, + ATTR_DIAGRAM_STOCK_LOSS, + ATTR_DIAGRAM_STOCK_PLUS +}; +*/ + +class OldModelWrapper +{ +public: + OldModelWrapper(); + virtual ~OldModelWrapper(); + + //model + //// BOOL IsXYChart() const; + BOOL HasScaleProperties() const; + BOOL IsBar() const; + BOOL Is3DChart() const; + //// BOOL Is3DPie() const; + BOOL IsStatisticChart() const; + BOOL HasAreaProperties() const; + + /// return TRUE if the current chart type supports a given axis type + BOOL ProvidesSecondaryYAxis() const;//was BOOL CanAxis(CHART_AXIS_SECONDARY_Y) + BOOL IsCol( long nRow ) const; +}; + +/* +#define CHATTR_COUNT (CHATTR_DIAGRAM_FLOOR + 1) + +enum OrderMode +{ + CHORDMODE_NONE, + CHORDMODE_X_AXIS, + CHORDMODE_Y_AXIS +}; + +#define CHORDMODE_COUNT (CHORDMODE_Y_AXIS + 1) + +#define AxisTypeX 1 +#define AxisTypeY 2 +#define AxisTypeZ 3 +*/ + +/************************************************************************* +|* +|* Attributs-Tab-Dialog +|* +\************************************************************************/ + +class ViewElementListProvider; + +class SchAttribTabDlg : public SfxTabDialog +{ +private: + ObjectType eObjectType; + bool bAffectsMultipleObjects;//is true if more than one object of the given type will be changed (e.g. all axes or all titles) + USHORT nDlgType; + USHORT nPageType; + + const OldModelWrapper * const m_pModelWrapper; + const ViewElementListProvider* const m_pViewElementListProvider; + + const SfxItemSet* mpSymbolAttr; + Graphic maSymbolGraphic; + + /* + XColorTable* pColorTab; + XGradientList* pGradientList; + XHatchList* pHatchingList; + XBitmapList* pBitmapList; + XDashList* pDashList; + XLineEndList* pLineEndList; + */ + + ChangeType nColorTableState; + ChangeType nGradientListState; + ChangeType nHatchingListState; + ChangeType nBitmapListState; + + static USHORT GetResId(ObjectType eObjectType); + ////static USHORT GetResId(AttrType eType); + virtual void PageCreated(USHORT nId, SfxTabPage& rPage); + +public: + SchAttribTabDlg(Window* pParent, ObjectType eType, + const SfxItemSet* pAttr, + const ViewElementListProvider* pViewElementListProvider, + const OldModelWrapper* pModel, + bool bAffectsMultipleObjects = false, + const SfxItemSet* pSymbolAttr=NULL, + Graphic aSymbolGraphic=Graphic()); + virtual ~SchAttribTabDlg(); +}; + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif + diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx new file mode 100644 index 000000000000..9f1ef04c6926 --- /dev/null +++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx @@ -0,0 +1,700 @@ +/************************************************************************* + * + * $RCSfile: AxisItemConverter.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "AxisItemConverter.hxx" +#include "ItemPropertyMap.hxx" +#include "CharacterPropertyItemConverter.hxx" +#include "GraphicPropertyItemConverter.hxx" +#include "SchSfxItemIds.hxx" +#include "SchWhichPairs.hxx" +#include "macros.hxx" +#include "Scaling.hxx" + +#ifndef _COM_SUN_STAR_LANG_XSERVICENAME_HPP_ +#include <com/sun/star/lang/XServiceName.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XAXIS_HPP_ +#include <drafts/com/sun/star/chart2/XAxis.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XBOUNDEDCOORDINATESYSTEM_HPP_ +#include <drafts/com/sun/star/chart2/XBoundedCoordinateSystem.hpp> +#endif + +// #ifndef _COMPHELPER_PROCESSFACTORY_HXX_ +// #include <comphelper/processfactory.hxx> +// #endif +// for SfxBoolItem +#ifndef _SFXENUMITEM_HXX +#include <svtools/eitem.hxx> +#endif +// for SvxDoubleItem +#ifndef _SVX_CHRTITEM_HXX +#define ITEMID_DOUBLE 0 +#include <svx/chrtitem.hxx> +#endif +// for SfxInt32Item +#ifndef _SFXINTITEM_HXX +#include <svtools/intitem.hxx> +#endif +#ifndef INCLUDED_RTL_MATH_HXX +#include <rtl/math.hxx> +#endif + +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +namespace +{ +::chart::wrapper::ItemPropertyMapType & lcl_GetAxisPropertyMap() +{ + static ::chart::wrapper::ItemPropertyMapType aAxisPropertyMap( + ::chart::wrapper::MakeItemPropertyMap + ( SCHATTR_AXIS_SHOWDESCR, C2U( "DisplayLabels" )) + ( SCHATTR_AXIS_TICKS, C2U( "MajorTickmarks" )) + ( SCHATTR_AXIS_HELPTICKS, C2U( "MinorTickmarks" )) + ( SCHATTR_TEXT_ORDER, C2U( "ArrangeOrder" )) + ( SCHATTR_TEXT_STACKED, C2U( "StackCharacters" )) + ( SCHATTR_TEXTBREAK, C2U( "TextBreak" )) + ( SCHATTR_TEXT_OVERLAP, C2U( "TextOverlap" )) + ); + + return aAxisPropertyMap; +}; +} // anonymous namespace + +namespace chart +{ +namespace wrapper +{ + +AxisItemConverter::AxisItemConverter( + const uno::Reference< beans::XPropertySet > & rPropertySet, + SfxItemPool& rItemPool, + SdrModel& rDrawModel, + NumberFormatterWrapper * pNumFormatter, + chart2::ExplicitScaleData * pScale /* = NULL */, + chart2::ExplicitIncrementData * pIncrement /* = NULL */, + double * pExplicitOrigin /* = NULL */ ) : + ItemConverter( rPropertySet, rItemPool ), + m_pNumberFormatterWrapper( pNumFormatter ), + m_pExplicitScale( NULL ), + m_pExplicitIncrement( NULL ), + m_pExplicitOrigin( NULL ) +{ + if( pScale ) + m_pExplicitScale = new chart2::ExplicitScaleData( *pScale ); + if( pIncrement ) + m_pExplicitIncrement = new chart2::ExplicitIncrementData( *pIncrement ); + if( pExplicitOrigin ) + m_pExplicitOrigin = new double( *pExplicitOrigin ); + + m_aConverters.push_back( new GraphicPropertyItemConverter( + rPropertySet, rItemPool, rDrawModel, + GraphicPropertyItemConverter::LINE_PROPERTIES )); + m_aConverters.push_back( new CharacterPropertyItemConverter( rPropertySet, rItemPool )); + + uno::Reference< chart2::XAxis > xAxis( rPropertySet, uno::UNO_QUERY ); + OSL_ASSERT( xAxis.is()); + if( xAxis.is()) + { + m_xAxis = xAxis; + + m_xCoordinateSystem.set( xAxis->getCoordinateSystem()); + if( m_xCoordinateSystem.is()) + { + m_nDimension = xAxis->getRepresentedDimension(); + } + else + { + OSL_ENSURE( false, "No coordinate system found at axis!" ); + } + } +} + +AxisItemConverter::~AxisItemConverter() +{ + delete m_pExplicitScale; + delete m_pExplicitIncrement; + delete m_pExplicitOrigin; + + ::std::for_each( m_aConverters.begin(), m_aConverters.end(), + DeleteItemConverterPtr() ); +} + +void AxisItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const +{ + ::std::for_each( m_aConverters.begin(), m_aConverters.end(), + FillItemSetFunc( rOutItemSet )); + + // own items + ItemConverter::FillItemSet( rOutItemSet ); +} + +bool AxisItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) +{ + bool bResult = false; + + ::std::for_each( m_aConverters.begin(), m_aConverters.end(), + ApplyItemSetFunc( rItemSet, bResult )); + + // own items + return ItemConverter::ApplyItemSet( rItemSet ) || bResult; +} + +const USHORT * AxisItemConverter::GetWhichPairs() const +{ + // must span all used items! + return nAxisWhichPairs; +} + +bool AxisItemConverter::GetItemPropertyName( USHORT nWhichId, ::rtl::OUString & rOutName ) const +{ + ItemPropertyMapType & rMap( lcl_GetAxisPropertyMap()); + ItemPropertyMapType::const_iterator aIt( rMap.find( nWhichId )); + +// OSL_TRACE( "Which-Id: %d", nWhichId ); + + if( aIt == rMap.end()) + return false; + + rOutName =(*aIt).second; +// OSL_TRACE( "Which-Id: %d, Entry found in map: %s.", nWhichId, +// ::rtl::OUStringToOString( rOutName, RTL_TEXTENCODING_ASCII_US ).getStr()); + + return true; +} + +void AxisItemConverter::FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const +{ + if( ! m_xAxis.is() || + ! m_xCoordinateSystem.is() ) + return; + + uno::Reference< chart2::XScale > xScale( m_xCoordinateSystem->getScaleByDimension( m_nDimension )); + OSL_ASSERT( xScale.is()); + uno::Reference< chart2::XIncrement > xIncrement( m_xAxis->getIncrement() ); + OSL_ASSERT( xIncrement.is()); + if( ! xScale.is() || + ! xIncrement.is() ) + return; + + const chart2::ScaleData aScale( xScale->getScaleData() ); + const chart2::IncrementData aInc( xIncrement->getIncrementData() ); + const uno::Sequence< chart2::SubIncrement > aSubIncs( xIncrement->getSubIncrements() ); + + switch( nWhichId ) + { + case SCHATTR_AXIS_AUTO_MAX: + // if the any has no value => auto is on + rOutItemSet.Put( SfxBoolItem( nWhichId, ( ! aScale.Maximum.hasValue()))); + break; + + case SCHATTR_AXIS_MAX: + if( aScale.Maximum.hasValue()) + { + OSL_ASSERT( aScale.Maximum.getValueTypeClass() == uno::TypeClass_DOUBLE ); + rOutItemSet.Put( + SvxDoubleItem( + *reinterpret_cast< const double * >( aScale.Maximum.getValue()), nWhichId )); + } + else + { + double fExplicitMax = 10.0; + if( m_pExplicitScale ) + fExplicitMax = m_pExplicitScale->Maximum; + + rOutItemSet.Put( + SvxDoubleItem( fExplicitMax, nWhichId )); + } + break; + + case SCHATTR_AXIS_AUTO_MIN: + // if the any has no value => auto is on + rOutItemSet.Put( SfxBoolItem( nWhichId, ( ! aScale.Minimum.hasValue()))); + break; + + case SCHATTR_AXIS_MIN: + if( aScale.Minimum.hasValue()) + { + OSL_ASSERT( aScale.Minimum.getValueTypeClass() == uno::TypeClass_DOUBLE ); + rOutItemSet.Put( + SvxDoubleItem( + *reinterpret_cast< const double * >( aScale.Minimum.getValue()), nWhichId )); + } + else + { + if( m_pExplicitScale ) + rOutItemSet.Put( SvxDoubleItem( m_pExplicitScale->Minimum, nWhichId )); + } + break; + + case SCHATTR_AXIS_LOGARITHM: + { + uno::Reference< lang::XServiceName > xServiceName( aScale.Scaling, uno::UNO_QUERY ); + BOOL bValue = + // if the following is true, we have logarithmic scaling, + // otherwise not (per definition) + ( xServiceName.is() && + (xServiceName->getServiceName()).equals( + C2U( "com.sun.star.chart2.LogarithmicScaling" )) ); + + rOutItemSet.Put( SfxBoolItem( nWhichId, bValue )); + } + break; + + // Increment + case SCHATTR_AXIS_AUTO_STEP_MAIN: + // if the any has no value => auto is on + rOutItemSet.Put( SfxBoolItem( nWhichId, ( ! aInc.Distance.hasValue()))); + break; + + case SCHATTR_AXIS_STEP_MAIN: + if( aInc.Distance.hasValue()) + { + OSL_ASSERT( aInc.Distance.getValueTypeClass() == uno::TypeClass_DOUBLE ); + rOutItemSet.Put( + SvxDoubleItem( + *reinterpret_cast< const double * >( aInc.Distance.getValue()), nWhichId )); + } + else + { + if( m_pExplicitIncrement ) + rOutItemSet.Put( SvxDoubleItem( m_pExplicitIncrement->Distance, nWhichId )); + } + break; + + // SubIncrement + case SCHATTR_AXIS_AUTO_STEP_HELP: + { + // if the any has no value => auto is on + rOutItemSet.Put( + SfxBoolItem( + nWhichId, + ! ( aSubIncs.getLength() > 0 && + aSubIncs[0].IntervalCount.hasValue() ))); + } + break; + + case SCHATTR_AXIS_STEP_HELP: + { + if( aSubIncs.getLength() > 0 && + aSubIncs[0].IntervalCount.hasValue()) + { + OSL_ASSERT( aSubIncs[0].IntervalCount.getValueTypeClass() == uno::TypeClass_LONG ); + rOutItemSet.Put( + SfxInt32Item( + nWhichId, + *reinterpret_cast< const sal_Int32 * >( + aSubIncs[0].IntervalCount.getValue()) )); + } + else + { + if( m_pExplicitIncrement && + m_pExplicitIncrement->SubIncrements.getLength() > 0 ) + { + rOutItemSet.Put( + SfxInt32Item( + nWhichId, + m_pExplicitIncrement->SubIncrements[0].IntervalCount )); + } + } + } + break; + + case SCHATTR_AXIS_AUTO_ORIGIN: + { + uno::Sequence< uno::Any > aCoord( m_xCoordinateSystem->getOrigin() ); + OSL_ASSERT( m_nDimension <= aCoord.getLength()); + rOutItemSet.Put( + SfxBoolItem( + nWhichId, + ! ( aCoord.getLength() > m_nDimension && + aCoord[ m_nDimension ].hasValue() ) )); + } + break; + + case SCHATTR_AXIS_ORIGIN: + { + bool bIsAuto = true; + uno::Sequence< uno::Any > aCoord( m_xCoordinateSystem->getOrigin() ); + if( aCoord.getLength() > m_nDimension && + aCoord[ m_nDimension ].hasValue() ) + { + OSL_ASSERT( aCoord[ m_nDimension ].getValueTypeClass() == uno::TypeClass_DOUBLE ); + rOutItemSet.Put( + SvxDoubleItem( + *reinterpret_cast< const double * >(aCoord[ m_nDimension ].getValue()), + nWhichId )); + bIsAuto = false; + } + + if( bIsAuto && m_pExplicitOrigin ) + rOutItemSet.Put( SvxDoubleItem( *m_pExplicitOrigin, nWhichId )); + } + break; + + case SCHATTR_TEXT_DEGREES: + { + // convert double to int (times 100) + double fVal; + + if( GetPropertySet()->getPropertyValue( C2U( "TextRotation" )) >>= fVal ) + { + rOutItemSet.Put( SfxInt32Item( nWhichId, static_cast< sal_Int32 >( + ::rtl::math::round( fVal * 100.0 ) ) )); + } + } + break; + + case SID_ATTR_NUMBERFORMAT_VALUE: +// case SCHATTR_AXIS_NUMFMT: + { + if( m_pNumberFormatterWrapper ) + { + chart2::NumberFormat aNumFmt; + if( GetPropertySet()->getPropertyValue( C2U( "NumberFormat" )) >>= aNumFmt ) + { + sal_Int32 nKey = m_pNumberFormatterWrapper->getKeyForNumberFormat( aNumFmt ); + + OSL_TRACE( "NumberFormat: ""%s"", Locale: %s_%s@%s, Key: %d", + U2C( aNumFmt.aFormat ), + U2C( aNumFmt.aLocale.Language ), + U2C( aNumFmt.aLocale.Country ), + U2C( aNumFmt.aLocale.Variant ), + nKey ); + rOutItemSet.Put( SfxUInt32Item( nWhichId, nKey )); + } + } + else + { + OSL_ENSURE( false, "No NumberFormatterWrapper !" ); + } + } + break; + +// case SID_ATTR_NUMBERFORMAT_SOURCE: + } +} + +bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet ) const +{ + if( ! ( m_xAxis.is() && + m_xCoordinateSystem.is())) + return false; + + uno::Reference< chart2::XScale > xScale( m_xCoordinateSystem->getScaleByDimension( m_nDimension )); + OSL_ASSERT( xScale.is()); + uno::Reference< chart2::XIncrement > xIncrement( m_xAxis->getIncrement() ); + OSL_ASSERT( xIncrement.is()); + if( ! xScale.is() || + ! xIncrement.is() ) + return false; + + chart2::ScaleData aScale( xScale->getScaleData() ); + chart2::IncrementData aInc( xIncrement->getIncrementData() ); + uno::Sequence< chart2::SubIncrement > aSubIncs( xIncrement->getSubIncrements() ); + uno::Sequence< uno::Any > aOrigin( m_xCoordinateSystem->getOrigin()); + + bool bSetScale = false; + bool bSetIncrement = false; + bool bSetSubIncrement = false; + bool bSetOrigin = false; + bool bChangedOtherwise = false; + + uno::Any aValue; + + switch( nWhichId ) + { + case SCHATTR_AXIS_AUTO_MAX: + if( (reinterpret_cast< const SfxBoolItem & >( + rItemSet.Get( nWhichId )).GetValue() )) + { + aScale.Maximum.clear(); + bSetScale = true; + } + // else SCHATTR_AXIS_MAX must have some value + break; + + case SCHATTR_AXIS_MAX: + // only if auto if false + if( ! (reinterpret_cast< const SfxBoolItem & >( + rItemSet.Get( SCHATTR_AXIS_AUTO_MAX )).GetValue() )) + { + rItemSet.Get( nWhichId ).QueryValue( aValue ); + + if( aScale.Maximum != aValue ) + { + aScale.Maximum = aValue; + bSetScale = true; + } + } + break; + + case SCHATTR_AXIS_AUTO_MIN: + if( (reinterpret_cast< const SfxBoolItem & >( + rItemSet.Get( nWhichId )).GetValue() )) + { + aScale.Minimum.clear(); + bSetScale = true; + } + // else SCHATTR_AXIS_MIN must have some value + break; + + case SCHATTR_AXIS_MIN: + // only if auto if false + if( ! (reinterpret_cast< const SfxBoolItem & >( + rItemSet.Get( SCHATTR_AXIS_AUTO_MIN )).GetValue() )) + { + rItemSet.Get( nWhichId ).QueryValue( aValue ); + + if( aScale.Minimum != aValue ) + { + aScale.Minimum = aValue; + bSetScale = true; + } + } + break; + + case SCHATTR_AXIS_LOGARITHM: + { + uno::Reference< lang::XServiceName > xServiceName( aScale.Scaling, uno::UNO_QUERY ); + bool bWasLogarithm = + // if the following is true, we have logarithmic scaling, + // otherwise not (per definition) + ( xServiceName.is() && + (xServiceName->getServiceName()).equals( + C2U( "com.sun.star.chart2.LogarithmicScaling" ))); + + if( (reinterpret_cast< const SfxBoolItem & >( + rItemSet.Get( nWhichId )).GetValue() )) + { + // logarithm is true + if( ! bWasLogarithm ) + { + aScale.Scaling = new LogarithmicScaling( 10.0 ); + bSetScale = true; + } + } + else + { + // logarithm is false => linear scaling + if( bWasLogarithm ) + { + aScale.Scaling = new LinearScaling( 1.0, 0.0 ); + bSetScale = true; + } + } + } + break; + + // Increment + case SCHATTR_AXIS_AUTO_STEP_MAIN: + if( (reinterpret_cast< const SfxBoolItem & >( + rItemSet.Get( nWhichId )).GetValue() )) + { + aInc.Distance.clear(); + bSetIncrement = true; + } + // else SCHATTR_AXIS_STEP_MAIN must have some value + break; + + case SCHATTR_AXIS_STEP_MAIN: + // only if auto if false + if( ! (reinterpret_cast< const SfxBoolItem & >( + rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_MAIN )).GetValue() )) + { + rItemSet.Get( nWhichId ).QueryValue( aValue ); + + if( aInc.Distance != aValue ) + { + aInc.Distance = aValue; + bSetIncrement = true; + } + } + break; + + // SubIncrement + case SCHATTR_AXIS_AUTO_STEP_HELP: + if( (reinterpret_cast< const SfxBoolItem & >( + rItemSet.Get( nWhichId )).GetValue() ) && + aSubIncs.getLength() > 0 && + aSubIncs[0].IntervalCount.hasValue() ) + { + aSubIncs[0].IntervalCount.clear(); + bSetSubIncrement = true; + } + // else SCHATTR_AXIS_STEP_MAIN must have some value + break; + + case SCHATTR_AXIS_STEP_HELP: + // only if auto if false + if( ! (reinterpret_cast< const SfxBoolItem & >( + rItemSet.Get( SCHATTR_AXIS_AUTO_STEP_HELP )).GetValue() ) && + aSubIncs.getLength() > 0 ) + { + rItemSet.Get( nWhichId ).QueryValue( aValue ); + + if( ! aSubIncs[0].IntervalCount.hasValue() || + aSubIncs[0].IntervalCount != aValue ) + { + OSL_ASSERT( aValue.getValueTypeClass() == uno::TypeClass_LONG ); + aSubIncs[0].IntervalCount = aValue; + bSetSubIncrement = true; + } + } + break; + + case SCHATTR_AXIS_AUTO_ORIGIN: + { + if( (reinterpret_cast< const SfxBoolItem & >( + rItemSet.Get( nWhichId )).GetValue() ) && + ( aOrigin.getLength() > m_nDimension && + aOrigin[ m_nDimension ].hasValue() )) + { + aOrigin[ m_nDimension ].clear(); + bSetOrigin = true; + } + } + break; + + case SCHATTR_AXIS_ORIGIN: + { + if( ! (reinterpret_cast< const SfxBoolItem & >( + rItemSet.Get( SCHATTR_AXIS_AUTO_ORIGIN )).GetValue() )) + { + if( aOrigin.getLength() > m_nDimension ) + { + rItemSet.Get( nWhichId ).QueryValue( aValue ); + if( aValue != aOrigin[ m_nDimension ] ) + { + aOrigin[ m_nDimension ] = aValue; + bSetOrigin = true; + } + } + } + } + break; + + case SCHATTR_TEXT_DEGREES: + { + // convert int to double (divided by 100) + double fVal = static_cast< double >( + reinterpret_cast< const SfxInt32Item & >( + rItemSet.Get( nWhichId )).GetValue()) / 100.0; + double fOldVal = 0.0; + bool bPropExisted = + ( GetPropertySet()->getPropertyValue( C2U( "TextRotation" )) >>= fOldVal ); + + if( ! bPropExisted || + ( bPropExisted && fOldVal != fVal )) + { + GetPropertySet()->setPropertyValue( C2U( "TextRotation" ), uno::makeAny( fVal )); + bChangedOtherwise = true; + } + } + break; + + case SID_ATTR_NUMBERFORMAT_VALUE: +// case SCHATTR_AXIS_NUMFMT: + { + if( m_pNumberFormatterWrapper ) + { + sal_Int32 nFmt = static_cast< sal_Int32 >( + reinterpret_cast< const SfxUInt32Item & >( + rItemSet.Get( nWhichId )).GetValue()); + + aValue = uno::makeAny( + m_pNumberFormatterWrapper->getNumberFormatForKey( nFmt )); + if( GetPropertySet()->getPropertyValue( C2U( "NumberFormat" )) != aValue ) + { + GetPropertySet()->setPropertyValue( C2U( "NumberFormat" ), aValue ); + bChangedOtherwise = true; + } + } + else + { + OSL_ENSURE( false, "No NumberFormatterWrapper !" ); + } + } + break; + +// case SID_ATTR_NUMBERFORMAT_SOURCE: + } + + if( bSetScale && + xScale.is() ) + xScale->setScaleData( aScale ); + if( bSetIncrement && + xIncrement.is() ) + xIncrement->setIncrementData( aInc ); + if( bSetSubIncrement && + xIncrement.is() ) + xIncrement->setSubIncrements( aSubIncs ); + if( bSetOrigin ) + m_xCoordinateSystem->setOrigin( aOrigin ); + + return (bSetScale || bSetIncrement || bSetSubIncrement || + bSetOrigin || bChangedOtherwise); +} + +} // namespace wrapper +} // namespace chart diff --git a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx new file mode 100644 index 000000000000..2c4d4ac6bf3c --- /dev/null +++ b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx @@ -0,0 +1,398 @@ +/************************************************************************* + * + * $RCSfile: CharacterPropertyItemConverter.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "CharacterPropertyItemConverter.hxx" +#include "SchWhichPairs.hxx" +#include "macros.hxx" +#include "ItemPropertyMap.hxx" + +#ifndef _EEITEM_HXX +#include <svx/eeitem.hxx> +#endif +#ifndef _SVX_UDLNITEM_HXX +#define ITEMID_UNDERLINE EE_CHAR_UNDERLINE +#include <svx/udlnitem.hxx> +#endif +#ifndef _SVX_FONTITEM_HXX +#define ITEMID_FONT EE_CHAR_FONTINFO +#include <svx/fontitem.hxx> +#endif +#ifndef _SVX_CRSDITEM_HXX +#define ITEMID_CROSSEDOUT EE_CHAR_STRIKEOUT +#include <svx/crsditem.hxx> +#endif +#ifndef _SVX_POSTITEM_HXX +#define ITEMID_POSTURE EE_CHAR_ITALIC +#include <svx/postitem.hxx> +#endif +#ifndef _SVX_WGHTITEM_HXX +#define ITEMID_WEIGHT EE_CHAR_WEIGHT +#include <svx/wghtitem.hxx> +#endif + +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_ +#include <com/sun/star/beans/XPropertyState.hpp> +#endif + +using namespace ::com::sun::star; + +namespace +{ +::chart::wrapper::ItemPropertyMapType & lcl_GetCharacterPropertyPropertyMap() +{ + static ::chart::wrapper::ItemPropertyMapType aCharacterPropertyMap( + ::chart::wrapper::MakeItemPropertyMap + ( EE_CHAR_COLOR, C2U( "CharColor" )) + ( EE_CHAR_FONTHEIGHT, C2U( "CharHeight" )) +// ( EE_CHAR_ITALIC, C2U( "CharPosture" )) +// ( EE_CHAR_WEIGHT, C2U( "CharWeight" )) +// ( EE_CHAR_STRIKEOUT, C2U( "CharStrikeout" )) + ( EE_CHAR_WLM, C2U( "CharWordMode" )) + ( EE_CHAR_SHADOW, C2U( "CharShadowed" )) + ( EE_CHAR_RELIEF, C2U( "CharRelief" )) + ( EE_CHAR_OUTLINE, C2U( "CharContoured" )) + ( EE_CHAR_EMPHASISMARK, C2U( "CharEmphasis" )) + ); + + return aCharacterPropertyMap; +} +} // anonymous namespace + +// ======================================== + +namespace chart +{ +namespace wrapper +{ + +CharacterPropertyItemConverter::CharacterPropertyItemConverter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropertySet, + SfxItemPool& rItemPool ) : + ItemConverter( rPropertySet, rItemPool ) +{} + +CharacterPropertyItemConverter::~CharacterPropertyItemConverter() +{} + +const USHORT * CharacterPropertyItemConverter::GetWhichPairs() const +{ + return nCharacterPropertyWhichPairs; +} + +bool CharacterPropertyItemConverter::GetItemPropertyName( USHORT nWhichId, ::rtl::OUString & rOutName ) const +{ + ItemPropertyMapType & rMap( lcl_GetCharacterPropertyPropertyMap()); + ItemPropertyMapType::const_iterator aIt( rMap.find( nWhichId )); + + if( aIt == rMap.end()) + return false; + + rOutName =(*aIt).second; + return true; +} + +void CharacterPropertyItemConverter::FillSpecialItem( + USHORT nWhichId, SfxItemSet & rOutItemSet ) const +{ + switch( nWhichId ) + { + case EE_CHAR_FONTINFO: + { + SvxFontItem aItem; + + aItem.PutValue( GetPropertySet()->getPropertyValue( C2U( "CharFontName" )), + MID_FONT_FAMILY_NAME ); + aItem.PutValue( GetPropertySet()->getPropertyValue( C2U( "CharFontFamily" )), + MID_FONT_FAMILY ); + aItem.PutValue( GetPropertySet()->getPropertyValue( C2U( "CharFontStyleName" )), + MID_FONT_STYLE_NAME ); + aItem.PutValue( GetPropertySet()->getPropertyValue( C2U( "CharFontCharSet" )), + MID_FONT_CHAR_SET ); + aItem.PutValue( GetPropertySet()->getPropertyValue( C2U( "CharFontPitch" )), + MID_FONT_PITCH ); + + rOutItemSet.Put( aItem ); + } + break; + + case EE_CHAR_UNDERLINE: + { + SvxUnderlineItem aItem; + bool bModified = false; + + uno::Any aValue( GetPropertySet()->getPropertyValue( C2U( "CharUnderline" ))); + if( aValue.hasValue()) + { + aItem.PutValue( aValue, MID_UNDERLINE ); + bModified = true; + } + + aValue = GetPropertySet()->getPropertyValue( C2U( "CharUnderlineHasColor" )); + if( aValue.hasValue() && + ( *reinterpret_cast< const sal_Bool * >( aValue.getValue()) != sal_False )) + { + aItem.PutValue( aValue, MID_UL_HASCOLOR ); + bModified = true; + } + + aValue = GetPropertySet()->getPropertyValue( C2U( "CharUnderlineColor" )); + if( aValue.hasValue()) + { + aItem.PutValue( aValue, MID_UL_COLOR ); + bModified = true; + } + + if( bModified ) + rOutItemSet.Put( aItem ); + } + break; + + case EE_CHAR_STRIKEOUT: + { + SvxCrossedOutItem aItem; + + uno::Any aValue( GetPropertySet()->getPropertyValue( C2U( "CharStrikeout" ))); + if( aValue.hasValue()) + { + // default member-id is MID_CROSSED_OUT (bool flag) + aItem.PutValue( aValue, MID_CROSS_OUT ); + rOutItemSet.Put( aItem ); + } + } + break; + + case EE_CHAR_ITALIC: + { + SvxPostureItem aItem; + + uno::Any aValue( GetPropertySet()->getPropertyValue( C2U( "CharPosture" ))); + if( aValue.hasValue()) + { + aItem.PutValue( aValue, MID_POSTURE ); + rOutItemSet.Put( aItem ); + } + } + break; + + case EE_CHAR_WEIGHT: + { + SvxWeightItem aItem; + + uno::Any aValue( GetPropertySet()->getPropertyValue( C2U( "CharWeight" ))); + if( aValue.hasValue()) + { + aItem.PutValue( aValue, MID_WEIGHT ); + rOutItemSet.Put( aItem ); + } + } + break; + } +} + +bool CharacterPropertyItemConverter::ApplySpecialItem( + USHORT nWhichId, const SfxItemSet & rItemSet ) const +{ + bool bChanged = false; + uno::Any aValue; + + switch( nWhichId ) + { + case EE_CHAR_FONTINFO: + { + const SvxFontItem & rItem = + reinterpret_cast< const SvxFontItem & >( + rItemSet.Get( nWhichId )); + + if( rItem.QueryValue( aValue, MID_FONT_FAMILY_NAME )) + { + if( aValue != GetPropertySet()->getPropertyValue( C2U( "CharFontName" ) )) + { + GetPropertySet()->setPropertyValue( C2U( "CharFontName" ), aValue ); + bChanged = true; + } + } + if( rItem.QueryValue( aValue, MID_FONT_FAMILY )) + { + if( aValue != GetPropertySet()->getPropertyValue( C2U( "CharFontFamily" ) )) + { + GetPropertySet()->setPropertyValue( C2U( "CharFontFamily" ), aValue ); + bChanged = true; + } + } + if( rItem.QueryValue( aValue, MID_FONT_STYLE_NAME )) + { + if( aValue != GetPropertySet()->getPropertyValue( C2U( "CharFontStyleName" ) )) + { + GetPropertySet()->setPropertyValue( C2U( "CharFontStyleName" ), aValue ); + bChanged = true; + } + } + if( rItem.QueryValue( aValue, MID_FONT_CHAR_SET )) + { + if( aValue != GetPropertySet()->getPropertyValue( C2U( "CharFontCharSet" ) )) + { + GetPropertySet()->setPropertyValue( C2U( "CharFontCharSet" ), aValue ); + bChanged = true; + } + } + if( rItem.QueryValue( aValue, MID_FONT_PITCH )) + { + if( aValue != GetPropertySet()->getPropertyValue( C2U( "CharFontPitch" ) )) + { + GetPropertySet()->setPropertyValue( C2U( "CharFontPitch" ), aValue ); + bChanged = true; + } + } + } + break; + + case EE_CHAR_UNDERLINE: + { + const SvxUnderlineItem & rItem = + reinterpret_cast< const SvxUnderlineItem & >( + rItemSet.Get( nWhichId )); + + if( rItem.QueryValue( aValue, MID_UNDERLINE )) + { + if( aValue != GetPropertySet()->getPropertyValue( C2U( "CharUnderline" ) )) + { + GetPropertySet()->setPropertyValue( C2U( "CharUnderline" ), aValue ); + bChanged = true; + } + } + + if( rItem.QueryValue( aValue, MID_UL_COLOR )) + { + if( aValue != GetPropertySet()->getPropertyValue( C2U( "CharUnderlineColor" ) )) + { + GetPropertySet()->setPropertyValue( C2U( "CharUnderlineColor" ), aValue ); + bChanged = true; + } + } + + if( rItem.QueryValue( aValue, MID_UL_HASCOLOR )) + { + if( aValue != GetPropertySet()->getPropertyValue( C2U( "CharUnderlineHasColor" ) )) + { + GetPropertySet()->setPropertyValue( C2U( "CharUnderlineHasColor" ), aValue ); + bChanged = true; + } + } + } + break; + + case EE_CHAR_STRIKEOUT: + { + const SvxCrossedOutItem & rItem = + reinterpret_cast< const SvxCrossedOutItem & >( + rItemSet.Get( nWhichId )); + + if( rItem.QueryValue( aValue, MID_CROSS_OUT )) + { + if( aValue != GetPropertySet()->getPropertyValue( C2U( "CharStrikeout" ) )) + { + GetPropertySet()->setPropertyValue( C2U( "CharStrikeout" ), aValue ); + bChanged = true; + } + } + } + break; + + case EE_CHAR_ITALIC: + { + const SvxPostureItem & rItem = + reinterpret_cast< const SvxPostureItem & >( + rItemSet.Get( nWhichId )); + + if( rItem.QueryValue( aValue, MID_POSTURE )) + { + if( aValue != GetPropertySet()->getPropertyValue( C2U( "CharPosture" ) )) + { + GetPropertySet()->setPropertyValue( C2U( "CharPosture" ), aValue ); + bChanged = true; + } + } + } + break; + + case EE_CHAR_WEIGHT: + { + const SvxWeightItem & rItem = + reinterpret_cast< const SvxWeightItem & >( + rItemSet.Get( nWhichId )); + + if( rItem.QueryValue( aValue, MID_WEIGHT )) + { + if( aValue != GetPropertySet()->getPropertyValue( C2U( "CharWeight" ) )) + { + GetPropertySet()->setPropertyValue( C2U( "CharWeight" ), aValue ); + bChanged = true; + } + } + } + break; + } + + return bChanged; +} + +} // namespace wrapper +} // namespace chart diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx new file mode 100644 index 000000000000..80ff5e49f6d3 --- /dev/null +++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx @@ -0,0 +1,337 @@ +/************************************************************************* + * + * $RCSfile: DataPointItemConverter.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "DataPointItemConverter.hxx" +#include "SchWhichPairs.hxx" +#include "macros.hxx" +#include "ItemPropertyMap.hxx" + +#include "GraphicPropertyItemConverter.hxx" +#include "CharacterPropertyItemConverter.hxx" + +#ifndef _SVX_CHRTITEM_HXX +#define ITEMID_CHARTDATADESCR SCHATTR_DATADESCR_DESCR +#include <svx/chrtitem.hxx> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_DATACAPTIONSTYLE_HPP__ +#include <drafts/com/sun/star/chart2/DataCaptionStyle.hpp> +#endif +#ifndef _SFXINTITEM_HXX +#include <svtools/intitem.hxx> +#endif + +#include <functional> +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +namespace +{ +::chart::wrapper::ItemPropertyMapType & lcl_GetDataPointPropertyMap() +{ + static ::chart::wrapper::ItemPropertyMapType aDataPointPropertyMap( + ::chart::wrapper::MakeItemPropertyMap + ( CHATTR_PIE_SEGMENT_OFFSET, C2U( "Offset" )) + ); + + return aDataPointPropertyMap; +}; +} // anonymous namespace + +namespace chart +{ +namespace wrapper +{ + +DataPointItemConverter::DataPointItemConverter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropertySet, + SfxItemPool& rItemPool, + SdrModel& rDrawModel, + NumberFormatterWrapper * pNumFormatter, + GraphicPropertyItemConverter::eGraphicObjectType eMapTo /* = FILL_PROPERTIES */ + ) : + ItemConverter( rPropertySet, rItemPool ), + m_pNumberFormatterWrapper( pNumFormatter ) +{ + m_aConverters.push_back( new GraphicPropertyItemConverter( rPropertySet, rItemPool, rDrawModel, eMapTo )); + m_aConverters.push_back( new CharacterPropertyItemConverter( rPropertySet, rItemPool )); +} + +DataPointItemConverter::~DataPointItemConverter() +{ + ::std::for_each( m_aConverters.begin(), m_aConverters.end(), + DeleteItemConverterPtr() ); +} + +void DataPointItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const +{ + ::std::for_each( m_aConverters.begin(), m_aConverters.end(), + FillItemSetFunc( rOutItemSet )); + + // own items + ItemConverter::FillItemSet( rOutItemSet ); +} + +bool DataPointItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) +{ + bool bResult = false; + + ::std::for_each( m_aConverters.begin(), m_aConverters.end(), + ApplyItemSetFunc( rItemSet, bResult )); + + // own items + return ItemConverter::ApplyItemSet( rItemSet ) || bResult; +} + +const USHORT * DataPointItemConverter::GetWhichPairs() const +{ + // must span all used items! + return nRowWhichPairs; +} + +bool DataPointItemConverter::GetItemPropertyName( USHORT nWhichId, ::rtl::OUString & rOutName ) const +{ + ItemPropertyMapType & rMap( lcl_GetDataPointPropertyMap()); + ItemPropertyMapType::const_iterator aIt( rMap.find( nWhichId )); + + if( aIt == rMap.end()) + return false; + + rOutName =(*aIt).second; + return true; +} + + +bool DataPointItemConverter::ApplySpecialItem( + USHORT nWhichId, const SfxItemSet & rItemSet ) const +{ + bool bChanged = false; + uno::Any aValue; + + switch( nWhichId ) + { + case SCHATTR_DATADESCR_DESCR: + { + const SvxChartDataDescrItem & rItem = + reinterpret_cast< const SvxChartDataDescrItem & >( + rItemSet.Get( nWhichId )); + + chart2::DataCaptionStyle aStyle; + if( GetPropertySet()->getPropertyValue( C2U( "DataCaption" )) >>= aStyle ) + { + switch( rItem.GetValue()) + { + case CHDESCR_NONE: + aStyle.ShowNumber = sal_False; + aStyle.ShowCategoryName = sal_False; + break; + case CHDESCR_VALUE: + aStyle.ShowNumber = sal_True; + aStyle.ShowNumberInPercent = sal_False; + aStyle.ShowCategoryName = sal_False; + break; + case CHDESCR_PERCENT: + aStyle.ShowNumber = sal_True; + aStyle.ShowNumberInPercent = sal_True; + aStyle.ShowCategoryName = sal_False; + break; + case CHDESCR_TEXT: + aStyle.ShowNumber = sal_False; + aStyle.ShowCategoryName = sal_True; + break; + case CHDESCR_TEXTANDPERCENT: + aStyle.ShowNumber = sal_True; + aStyle.ShowNumberInPercent = sal_True; + aStyle.ShowCategoryName = sal_True; + break; + case CHDESCR_TEXTANDVALUE: + aStyle.ShowNumber = sal_True; + aStyle.ShowNumberInPercent = sal_False; + aStyle.ShowCategoryName = sal_True; + break; + default: + break; + } + + aValue <<= aStyle; + if( aValue != GetPropertySet()->getPropertyValue( C2U( "DataCaption" ) )) + { + GetPropertySet()->setPropertyValue( C2U( "DataCaption" ), aValue ); + bChanged = true; + } + } + } + break; + + case SCHATTR_DATADESCR_SHOW_SYM: + { + const SvxChartDataDescrItem & rItem = + reinterpret_cast< const SvxChartDataDescrItem & >( + rItemSet.Get( nWhichId )); + + chart2::DataCaptionStyle aStyle; + if( GetPropertySet()->getPropertyValue( C2U( "DataCaption" )) >>= aStyle ) + { + sal_Bool bOldValue = aStyle.ShowLegendSymbol; + aStyle.ShowLegendSymbol = static_cast< sal_Bool >( rItem.GetValue() ); + if( bOldValue != aStyle.ShowLegendSymbol ) + { + GetPropertySet()->setPropertyValue( C2U( "DataCaption" ), uno::makeAny( aStyle )); + bChanged = true; + } + } + } + break; + + case SID_ATTR_NUMBERFORMAT_VALUE: + { + if( m_pNumberFormatterWrapper ) + { + sal_Int32 nFmt = static_cast< sal_Int32 >( + reinterpret_cast< const SfxUInt32Item & >( + rItemSet.Get( nWhichId )).GetValue()); + + aValue = uno::makeAny( + m_pNumberFormatterWrapper->getNumberFormatForKey( nFmt )); + if( GetPropertySet()->getPropertyValue( C2U( "NumberFormat" )) != aValue ) + { + GetPropertySet()->setPropertyValue( C2U( "NumberFormat" ), aValue ); + bChanged = true; + } + } + else + { + OSL_ENSURE( false, "No NumberFormatterWrapper !" ); + } + } + break; + } + + return bChanged; +} + +void DataPointItemConverter::FillSpecialItem( + USHORT nWhichId, SfxItemSet & rOutItemSet ) const +{ + switch( nWhichId ) + { + case SCHATTR_DATADESCR_DESCR: + case SCHATTR_DATADESCR_SHOW_SYM: + { + chart2::DataCaptionStyle aStyle; + if( GetPropertySet()->getPropertyValue( C2U( "DataCaption" )) >>= aStyle ) + { + SvxChartDataDescr aDescr; + + if( aStyle.ShowNumber ) + { + if( aStyle.ShowNumberInPercent ) + { + if( aStyle.ShowCategoryName ) + aDescr = CHDESCR_TEXTANDPERCENT; + else + aDescr = CHDESCR_PERCENT; + } + else + { + if( aStyle.ShowCategoryName ) + aDescr = CHDESCR_TEXTANDVALUE; + else + aDescr = CHDESCR_VALUE; + } + } + else + { + if( aStyle.ShowCategoryName ) + aDescr = CHDESCR_TEXT; + else + aDescr = CHDESCR_NONE; + } + + rOutItemSet.Put( SvxChartDataDescrItem( aDescr )); + rOutItemSet.Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_SYM, aStyle.ShowLegendSymbol )); + } + } + break; + + case SID_ATTR_NUMBERFORMAT_VALUE: + { + if( m_pNumberFormatterWrapper ) + { + chart2::NumberFormat aNumFmt; + if( GetPropertySet()->getPropertyValue( C2U( "NumberFormat" )) >>= aNumFmt ); + { + sal_Int32 nKey = m_pNumberFormatterWrapper->getKeyForNumberFormat( aNumFmt ); + rOutItemSet.Put( SfxUInt32Item( nWhichId, nKey )); + } + } + else + { + OSL_ENSURE( false, "No NumberFormatterWrapper !" ); + } + } + break; + } +} + +} // namespace wrapper +} // namespace chart diff --git a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx new file mode 100644 index 000000000000..af423d7f001b --- /dev/null +++ b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx @@ -0,0 +1,710 @@ +/************************************************************************* + * + * $RCSfile: GraphicPropertyItemConverter.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "GraphicPropertyItemConverter.hxx" +#include "SchWhichPairs.hxx" +#include "macros.hxx" +#include "ItemPropertyMap.hxx" + +// #ifndef _SFXINTITEM_HXX +// #include <svtools/intitem.hxx> +// #endif +#ifndef _SVX_XFLCLIT_HXX +#include <svx/xflclit.hxx> +#endif +#ifndef _SVX_XLNCLIT_HXX +#include <svx/xlnclit.hxx> +#endif +#ifndef _SVX_XFLBMTIT_HXX +#include <svx/xflbmtit.hxx> +#endif +#ifndef _SVX_XFLBSTIT_HXX +#include <svx/xflbstit.hxx> +#endif +#ifndef _SVX_XBTMPIT_HXX +#include <svx/xbtmpit.hxx> +#endif +#ifndef _SVX_XFLFTRIT_HXX +#include <svx/xflftrit.hxx> +#endif +#ifndef _SVX_XLNDSIT_HXX +#include <svx/xlndsit.hxx> +#endif +#ifndef _SVX_XFLHTIT_HXX +#include <svx/xflhtit.hxx> +#endif +#ifndef _SVX_XFLGRIT_HXX +#include <svx/xflgrit.hxx> +#endif +#ifndef _EEITEM_HXX +#include <svx/eeitem.hxx> +#endif +#ifndef _SVX_UDLNITEM_HXX +#define ITEMID_UNDERLINE EE_CHAR_UNDERLINE +#include <svx/udlnitem.hxx> +#endif +#ifndef _SVX_FONTITEM_HXX +#define ITEMID_FONT EE_CHAR_FONTINFO +#include <svx/fontitem.hxx> +#endif +// for SfxBoolItem +#ifndef _SFXENUMITEM_HXX +#include <svtools/eitem.hxx> +#endif +// for XFillGradientStepCountItem +#ifndef _SVX_XGRSCIT_HXX +#include <svx/xgrscit.hxx> +#endif + +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_ +#include <com/sun/star/beans/XPropertyState.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_FILLBITMAP_HPP_ +#include <drafts/com/sun/star/chart2/FillBitmap.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_TRANSPARENCYSTYLE_HPP_ +#include <drafts/com/sun/star/chart2/TransparencyStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_AWT_GRADIENT_HPP_ +#include <com/sun/star/awt/Gradient.hpp> +#endif + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +namespace +{ +::chart::wrapper::ItemPropertyMapType & lcl_GetDataPointFilledPropertyMap() +{ + static ::chart::wrapper::ItemPropertyMapType aDataPointPropertyFilledMap( + ::chart::wrapper::MakeItemPropertyMap + ( XATTR_FILLSTYLE, C2U( "FillStyle" )) + ( XATTR_FILLCOLOR, C2U( "Color" )) + ( XATTR_FILLTRANSPARENCE, C2U( "Transparency" )) +// ( XATTR_FILLGRADIENT, C2U( "Gradient" )) +// ( XATTR_FILLHATCH, C2U( "Hatch" )) + ( XATTR_LINECOLOR, C2U( "BorderColor" )) + ( XATTR_LINESTYLE, C2U( "BorderStyle" )) + ( XATTR_LINEWIDTH, C2U( "BorderWidth" )) +// ( XATTR_LINEDASH, C2U( "BorderDash" )) + ( XATTR_LINETRANSPARENCE, C2U( "BorderTransparency" )) + ); + + return aDataPointPropertyFilledMap; +} +::chart::wrapper::ItemPropertyMapType & lcl_GetDataPointLinePropertyMap() +{ + static ::chart::wrapper::ItemPropertyMapType aDataPointPropertyLineMap( + ::chart::wrapper::MakeItemPropertyMap + ( XATTR_LINECOLOR, C2U( "Color" )) + ( XATTR_LINETRANSPARENCE, C2U( "Transparency" )) + ( XATTR_LINESTYLE, C2U( "LineStyle" )) + ( XATTR_LINEWIDTH, C2U( "LineWidth" )) +// ( XATTR_LINEDASH, C2U( "LineDash" )) + ); + + return aDataPointPropertyLineMap; +} +::chart::wrapper::ItemPropertyMapType & lcl_GetLinePropertyMap() +{ + static ::chart::wrapper::ItemPropertyMapType aLinePropertyMap( + ::chart::wrapper::MakeItemPropertyMap + ( XATTR_LINESTYLE, C2U( "LineStyle" )) + ( XATTR_LINEWIDTH, C2U( "LineWidth" )) +// ( XATTR_LINEDASH, C2U( "LineDash" )) + ( XATTR_LINECOLOR, C2U( "LineColor" )) + ( XATTR_LINETRANSPARENCE, C2U( "LineTransparence" )) + ( XATTR_LINEJOINT, C2U( "LineJoint" )) + ); + + return aLinePropertyMap; +} +::chart::wrapper::ItemPropertyMapType & lcl_GetFillPropertyMap() +{ + static ::chart::wrapper::ItemPropertyMapType aFillPropertyMap( + ::chart::wrapper::MakeItemPropertyMap + ( XATTR_FILLSTYLE, C2U( "FillStyle" )) + ( XATTR_FILLCOLOR, C2U( "FillColor" )) + ( XATTR_FILLTRANSPARENCE, C2U( "FillTransparence" )) +// ( XATTR_FILLGRADIENT, C2U( "FillGradient" )) +// ( XATTR_FILLHATCH, C2U( "FillHatch" )) + ); + + return aFillPropertyMap; +} +} // anonymous namespace + +// ======================================== + +namespace chart +{ +namespace wrapper +{ + +GraphicPropertyItemConverter::GraphicPropertyItemConverter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropertySet, + SfxItemPool& rItemPool, + SdrModel& rDrawModel, + eGraphicObjectType eObjectType /* = FILL_PROPERTIES */ ) : + ItemConverter( rPropertySet, rItemPool ), + m_eGraphicObjectType( eObjectType ), + m_rDrawModel( rDrawModel ) +{} + +GraphicPropertyItemConverter::~GraphicPropertyItemConverter() +{} + +const USHORT * GraphicPropertyItemConverter::GetWhichPairs() const +{ + const USHORT * pResult = NULL; + + switch( m_eGraphicObjectType ) + { + case LINE_DATA_POINT: + case FILLED_DATA_POINT: + pResult = nRowWhichPairs; break; + case LINE_PROPERTIES: + pResult = nLinePropertyWhichPairs; break; + case FILL_PROPERTIES: + pResult = nFillPropertyWhichPairs; break; + case LINE_AND_FILL_PROPERTIES: + pResult = nLineAndFillPropertyWhichPairs; break; + } + + return pResult; +} + +bool GraphicPropertyItemConverter::GetItemPropertyName( USHORT nWhichId, ::rtl::OUString & rOutName ) const +{ + ::chart::wrapper::ItemPropertyMapType::const_iterator aEndIt; + ::chart::wrapper::ItemPropertyMapType::const_iterator aIt; + + switch( m_eGraphicObjectType ) + { + case LINE_DATA_POINT: + aEndIt = lcl_GetDataPointLinePropertyMap().end(); + aIt = lcl_GetDataPointLinePropertyMap().find( nWhichId ); + break; + case FILLED_DATA_POINT: + aEndIt = lcl_GetDataPointFilledPropertyMap().end(); + aIt = lcl_GetDataPointFilledPropertyMap().find( nWhichId ); + break; + case LINE_PROPERTIES: + aEndIt = lcl_GetLinePropertyMap().end(); + aIt = lcl_GetLinePropertyMap().find( nWhichId ); + break; + + case FILL_PROPERTIES: + aEndIt = lcl_GetFillPropertyMap().end(); + aIt = lcl_GetFillPropertyMap().find( nWhichId ); + break; + + case LINE_AND_FILL_PROPERTIES: + // line + aEndIt = lcl_GetLinePropertyMap().end(); + aIt = lcl_GetLinePropertyMap().find( nWhichId ); + + // not found => try fill + if( aIt == aEndIt ) + { + aEndIt = lcl_GetFillPropertyMap().end(); + aIt = lcl_GetFillPropertyMap().find( nWhichId ); + } + break; + } + + if( aIt == aEndIt ) + return false; + + rOutName =(*aIt).second; + return true; +} + +void GraphicPropertyItemConverter::FillSpecialItem( + USHORT nWhichId, SfxItemSet & rOutItemSet ) const +{ +// if( m_eGraphicObjectType == LINE_DATA_POINT || +// m_eGraphicObjectType == LINE_PROPERTIES ) +// return; + + switch( nWhichId ) + { + // bitmap property + case XATTR_FILLBITMAP: + case XATTR_FILLBMP_TILE: + case XATTR_FILLBMP_POS: + case XATTR_FILLBMP_SIZEX: + case XATTR_FILLBMP_SIZEY: + case XATTR_FILLBMP_SIZELOG: + case XATTR_FILLBMP_TILEOFFSETX: + case XATTR_FILLBMP_TILEOFFSETY: + case XATTR_FILLBMP_STRETCH: + case XATTR_FILLBMP_POSOFFSETX: + case XATTR_FILLBMP_POSOFFSETY: + // avoid assertions while bitmap stuff is not working +// try +// { +// FillBitmapItem( nWhichId, rOutItemSet ); +// } +// catch( beans::UnknownPropertyException ex ) +// { +// ASSERT_EXCEPTION( ex ); +// } + break; + + case XATTR_FILLFLOATTRANSPARENCE: + { + try + { + chart2::TransparencyStyle aTranspStyle; + ( GetPropertySet()->getPropertyValue( C2U( "TransparencyStyle" ))) + >>= aTranspStyle; + + uno::Any aValue( GetPropertySet()->getPropertyValue( C2U( "TransparencyGradient" ))); + if( aValue.hasValue()) + { + XFillFloatTransparenceItem aItem; + aItem.PutValue( aValue ); + + // this is important to enable the item + aItem.SetEnabled( ( aTranspStyle == chart2::TransparencyStyle_GRADIENT )); + rOutItemSet.Put( aItem ); + } + } + catch( beans::UnknownPropertyException ex ) + { + ASSERT_EXCEPTION( ex ); + } + } + break; + + case XATTR_GRADIENTSTEPCOUNT: + { + ::rtl::OUString aPropName = + (m_eGraphicObjectType == FILLED_DATA_POINT) + ? C2U( "Gradient" ) + : C2U( "FillGradient" ); + try + { + awt::Gradient aGradient; + if( GetPropertySet()->getPropertyValue( aPropName ) >>= aGradient ) + { + rOutItemSet.Put( XGradientStepCountItem( aGradient.StepCount )); + } + } + catch( beans::UnknownPropertyException ex ) + { + ASSERT_EXCEPTION( ex ); + } + } + break; + + case XATTR_LINEDASH: + { + ::rtl::OUString aPropName = + (m_eGraphicObjectType == FILLED_DATA_POINT) + ? C2U( "BorderDash" ) + : C2U( "LineDash" ); + + XLineDashItem aItem; + aItem.PutValue( GetPropertySet()->getPropertyValue( aPropName ) ); + + // find the name for the dialog table + XLineDashItem * pItemToPut = & aItem; + pItemToPut = aItem.checkForUniqueItem( & m_rDrawModel ); + + rOutItemSet.Put( * pItemToPut ); + } + break; + + case XATTR_FILLGRADIENT: + { + ::rtl::OUString aPropName = + (m_eGraphicObjectType == FILLED_DATA_POINT) + ? C2U( "Gradient" ) + : C2U( "FillGradient" ); + + XFillGradientItem aItem; + aItem.PutValue( GetPropertySet()->getPropertyValue( aPropName ) ); + + // find the name for the dialog table + XFillGradientItem * pItemToPut = & aItem; + pItemToPut = aItem.checkForUniqueItem( & m_rDrawModel ); + + rOutItemSet.Put( * pItemToPut ); + } + break; + + case XATTR_FILLHATCH: + { + ::rtl::OUString aPropName = + (m_eGraphicObjectType == FILLED_DATA_POINT) + ? C2U( "Hatch" ) + : C2U( "FillHatch" ); + + XFillHatchItem aItem; + aItem.PutValue( GetPropertySet()->getPropertyValue( aPropName ) ); + + // find the name for the dialog table + XFillHatchItem * pItemToPut = & aItem; + pItemToPut = aItem.checkForUniqueItem( & m_rDrawModel ); + + rOutItemSet.Put( * pItemToPut ); + } + break; + + } +} + +bool GraphicPropertyItemConverter::ApplySpecialItem( + USHORT nWhichId, const SfxItemSet & rItemSet ) const +{ +// if( m_eGraphicObjectType == LINE_DATA_POINT || +// m_eGraphicObjectType == LINE_PROPERTIES ) +// return false; + + bool bChanged = false; + uno::Any aValue; + + switch( nWhichId ) + { + // bitmap property + case XATTR_FILLBITMAP: + case XATTR_FILLBMP_TILE: + case XATTR_FILLBMP_POS: + case XATTR_FILLBMP_SIZEX: + case XATTR_FILLBMP_SIZEY: + case XATTR_FILLBMP_SIZELOG: + case XATTR_FILLBMP_TILEOFFSETX: + case XATTR_FILLBMP_TILEOFFSETY: + case XATTR_FILLBMP_STRETCH: + case XATTR_FILLBMP_POSOFFSETX: + case XATTR_FILLBMP_POSOFFSETY: + // avoid assertions while bitmap stuff is not working +// try +// { +// ApplyBitmapItem( nWhichId, rItemSet ); +// bChanged = true; +// } +// catch( beans::UnknownPropertyException ex ) +// { +// ASSERT_EXCEPTION( ex ); +// } + break; + + case XATTR_FILLFLOATTRANSPARENCE: + try + { + const XFillFloatTransparenceItem & rItem = + reinterpret_cast< const XFillFloatTransparenceItem & >( + rItemSet.Get( nWhichId )); + if( rItem.IsEnabled() ) + { + rItem.QueryValue( aValue ); + GetPropertySet()->setPropertyValue( C2U( "TransparencyGradient" ), aValue ); + GetPropertySet()->setPropertyValue( C2U( "TransparencyStyle" ), + uno::makeAny( chart2::TransparencyStyle_GRADIENT )); + } + else + { + GetPropertySet()->setPropertyValue( + C2U( "TransparencyStyle" ), + uno::makeAny( chart2::TransparencyStyle_LINEAR )); + } + bChanged = true; + } + catch( beans::UnknownPropertyException ex ) + { + ASSERT_EXCEPTION( ex ); + } + break; + + case XATTR_GRADIENTSTEPCOUNT: + { + ::rtl::OUString aPropName = + (m_eGraphicObjectType == FILLED_DATA_POINT) + ? C2U( "Gradient" ) + : C2U( "FillGradient" ); + try + { + sal_Int16 nStepCount = + ( reinterpret_cast< const XGradientStepCountItem & >( + rItemSet.Get( nWhichId ))).GetValue(); + + awt::Gradient aGradient; + if( GetPropertySet()->getPropertyValue( aPropName ) >>= aGradient ) + { + if( aGradient.StepCount != nStepCount ) + { + aGradient.StepCount = nStepCount; + GetPropertySet()->setPropertyValue( + aPropName, + uno::makeAny( aGradient )); + bChanged = true; + } + } + } + catch( beans::UnknownPropertyException ex ) + { + ASSERT_EXCEPTION( ex ); + } + } + break; + + case XATTR_LINEDASH: + { + ::rtl::OUString aPropName = + (m_eGraphicObjectType == FILLED_DATA_POINT) + ? C2U( "BorderDash" ) + : C2U( "LineDash" ); + + const XLineDashItem & rItem = + reinterpret_cast< const XLineDashItem & >( + rItemSet.Get( nWhichId )); + + if( rItem.QueryValue( aValue )) + { + if( aValue != GetPropertySet()->getPropertyValue( aPropName )) + { + GetPropertySet()->setPropertyValue( aPropName, aValue ); + bChanged = true; + } + } + } + break; + + case XATTR_FILLGRADIENT: + { + ::rtl::OUString aPropName = + (m_eGraphicObjectType == FILLED_DATA_POINT) + ? C2U( "Gradient" ) + : C2U( "FillGradient" ); + + const XFillGradientItem & rItem = + reinterpret_cast< const XFillGradientItem & >( + rItemSet.Get( nWhichId )); + + if( rItem.QueryValue( aValue )) + { + if( aValue != GetPropertySet()->getPropertyValue( aPropName )) + { + GetPropertySet()->setPropertyValue( aPropName, aValue ); + bChanged = true; + } + } + } + break; + + case XATTR_FILLHATCH: + { + ::rtl::OUString aPropName = + (m_eGraphicObjectType == FILLED_DATA_POINT) + ? C2U( "Hatch" ) + : C2U( "FillHatch" ); + + const XFillHatchItem & rItem = + reinterpret_cast< const XFillHatchItem & >( + rItemSet.Get( nWhichId )); + + if( rItem.QueryValue( aValue )) + { + if( aValue != GetPropertySet()->getPropertyValue( aPropName )) + { + GetPropertySet()->setPropertyValue( aPropName, aValue ); + bChanged = true; + } + } + } + break; + } + + return bChanged; +} + +void GraphicPropertyItemConverter::FillBitmapItem( + USHORT nWhichId, SfxItemSet & rOutItemSet ) const + throw( beans::UnknownPropertyException ) +{ + uno::Reference< beans::XPropertySet > xProp( GetPropertySet() ); + OSL_ASSERT( xProp.is()); + chart2::FillBitmap aBitmap; + ( xProp->getPropertyValue( C2U( "Bitmap" ))) >>= aBitmap; + + switch( nWhichId ) + { + // bitmap property + case XATTR_FILLBITMAP: + { + XFillBitmapItem aBmpIt; + aBmpIt.PutValue( uno::makeAny( aBitmap.aURL ), MID_GRAFURL ); + rOutItemSet.Put( aBmpIt ); + } + break; + + case XATTR_FILLBMP_TILE: + rOutItemSet.Put( XFillBmpTileItem( + aBitmap.aBitmapMode == drawing::BitmapMode_REPEAT )); + rOutItemSet.Put( XFillBmpStretchItem( FALSE )); + break; + case XATTR_FILLBMP_STRETCH: + rOutItemSet.Put( XFillBmpStretchItem( + aBitmap.aBitmapMode == drawing::BitmapMode_STRETCH )); + rOutItemSet.Put( XFillBmpTileItem( FALSE )); + break; + case XATTR_FILLBMP_POS: + break; + case XATTR_FILLBMP_SIZEX: + break; + case XATTR_FILLBMP_SIZEY: + break; + case XATTR_FILLBMP_SIZELOG: + break; + case XATTR_FILLBMP_TILEOFFSETX: + break; + case XATTR_FILLBMP_TILEOFFSETY: + break; + case XATTR_FILLBMP_POSOFFSETX: + break; + case XATTR_FILLBMP_POSOFFSETY: + break; + } +} + +void GraphicPropertyItemConverter::ApplyBitmapItem( + USHORT nWhichId, const SfxItemSet & rItemSet ) const + throw( beans::UnknownPropertyException ) +{ + static const ::rtl::OUString aBitmapPropName( + RTL_CONSTASCII_USTRINGPARAM( "Bitmap" )); + uno::Reference< beans::XPropertySet > xProp( GetPropertySet() ); + OSL_ASSERT( xProp.is()); + chart2::FillBitmap aBitmap; + uno::Any aValue; + + try + { + ( xProp->getPropertyValue( aBitmapPropName )) >>= aBitmap; + + switch( nWhichId ) + { + // bitmap property + case XATTR_FILLBITMAP: + { + const XFillBitmapItem & rBitmapItem = + reinterpret_cast< const XFillBitmapItem & >( + rItemSet.Get( nWhichId )); + rBitmapItem.QueryValue( aValue, MID_GRAFURL ); + aValue >>= aBitmap.aURL; + + // must remember bitmap, so that URL stays valid + //ToDo: Never deleted yet !!! +// GraphicObject * pTESTING_CACHE = new GraphicObject( +// rBitmapItem.GetValue().GetGraphicObject() ); + } + break; + + case XATTR_FILLBMP_TILE: + case XATTR_FILLBMP_STRETCH: + { + const XFillBmpStretchItem & rStretchItem = + reinterpret_cast< const XFillBmpStretchItem & >( + rItemSet.Get( XATTR_FILLBMP_STRETCH )); + const XFillBmpTileItem & rTileItem = + reinterpret_cast< const XFillBmpTileItem & >( + rItemSet.Get( XATTR_FILLBMP_TILE )); + + if( rTileItem.GetValue() != FALSE ) + aBitmap.aBitmapMode = drawing::BitmapMode_REPEAT; + else if( rStretchItem.GetValue() != FALSE ) + aBitmap.aBitmapMode = drawing::BitmapMode_STRETCH; + else + aBitmap.aBitmapMode = drawing::BitmapMode_NO_REPEAT; + } + break; + + case XATTR_FILLBMP_POS: + break; + case XATTR_FILLBMP_SIZEX: + break; + case XATTR_FILLBMP_SIZEY: + break; + case XATTR_FILLBMP_SIZELOG: + break; + case XATTR_FILLBMP_TILEOFFSETX: + break; + case XATTR_FILLBMP_TILEOFFSETY: + break; + case XATTR_FILLBMP_POSOFFSETX: + break; + case XATTR_FILLBMP_POSOFFSETY: + break; + } + + xProp->setPropertyValue( aBitmapPropName, uno::makeAny( aBitmap )); + } + catch( beans::UnknownPropertyException ex ) + { + ASSERT_EXCEPTION( ex ); + } +} + +} // namespace wrapper +} // namespace chart diff --git a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx new file mode 100644 index 000000000000..c8f844a18e4a --- /dev/null +++ b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx @@ -0,0 +1,296 @@ +/************************************************************************* + * + * $RCSfile: ItemConverter.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ItemConverter.hxx" +#include "SchItemPool.hxx" + +// only used for OSL_ENSURE +#if OSL_DEBUG_LEVEL > 0 +#include "macros.hxx" +#endif + +#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_ +#include <com/sun/star/lang/XComponent.hpp> +#endif +#ifndef _SFX_ITEMPROP_HXX +#include <svtools/itemprop.hxx> +#endif + +#ifndef _SFXITEMITER_HXX +#include <svtools/itemiter.hxx> +#endif +// header for class SfxWhichIter +#ifndef _SFX_WHITER_HXX +#include <svtools/whiter.hxx> +#endif + +using namespace ::com::sun::star; + +namespace chart +{ +namespace wrapper +{ + +ItemConverter::ItemConverter( + const uno::Reference< beans::XPropertySet > & rPropertySet, + SfxItemPool& rItemPool ) : + m_xPropertySet( rPropertySet ), + m_xPropertySetInfo( NULL ), + m_rItemPool( rItemPool ), + m_bIsValid( true ) +{ + if( m_xPropertySet.is()) + { + m_xPropertySetInfo = m_xPropertySet->getPropertySetInfo(); + + // Note: Do not add this as Reference in the CTOR !!!! +// uno::Reference< lang::XComponent > xComp( m_xPropertySet, uno::UNO_QUERY ); +// if( xComp.is()) +// { +// xComp->addEventListener( this ); +// } + } +} + +ItemConverter::~ItemConverter() +{} + + +//static +SfxItemPool* ItemConverter::CreateSchItemPool() +{ + return new SchItemPool(); +} + +SfxItemPool & ItemConverter::GetItemPool() const +{ + return m_rItemPool; +} + +SfxItemSet ItemConverter::CreateEmptyItemSet() const +{ + return SfxItemSet( GetItemPool(), GetWhichPairs() ); +} + +uno::Reference< beans::XPropertySet > ItemConverter::GetPropertySet() const +{ + return m_xPropertySet; +} + +void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const +{ + const USHORT * pRanges = rOutItemSet.GetRanges(); + ::rtl::OUString aPropName; + SfxItemPool & rPool = GetItemPool(); + + OSL_ASSERT( pRanges != NULL ); + OSL_ASSERT( m_xPropertySetInfo.is()); + OSL_ASSERT( m_xPropertySet.is()); + + while( (*pRanges) != 0) + { + USHORT nBeg = (*pRanges); + ++pRanges; + USHORT nEnd = (*pRanges); + ++pRanges; + + OSL_ASSERT( nBeg <= nEnd ); + for( USHORT nWhich = nBeg; nWhich <= nEnd; ++nWhich ) + { + if( GetItemPropertyName( nWhich, aPropName )) + { +#if OSL_DEBUG_LEVEL > 0 + try + { + beans::Property aProp( m_xPropertySetInfo->getPropertyByName( aPropName )); + OSL_ASSERT( aProp.Name.equals( aPropName )); + } + catch( beans::UnknownPropertyException ex ) + { + ASSERT_EXCEPTION( ex ); + } +#endif + + // put the Property into the itemset + SfxPoolItem * pItem = rPool.GetDefaultItem( nWhich ).Clone(); + + if( pItem ) + { + try + { + if( ! pItem->PutValue( m_xPropertySet->getPropertyValue( aPropName ), + 0 // nMemberId + )) + { + delete pItem; +// throw lang::IllegalArgumentException(); + } + else + { + rOutItemSet.Put( *pItem, nWhich ); + delete pItem; + } + } + catch( beans::UnknownPropertyException ex ) + { + OSL_ENSURE( false, U2C( ex.Message + C2U( " - unknown Property: " ) + aPropName ) ); + delete pItem; + } + } + } + else + { + FillSpecialItem( nWhich, rOutItemSet ); + } + } + } +} + +bool ItemConverter::GetItemPropertyName( + USHORT nWhichId, ::rtl::OUString & rOutName ) const +{ + return false; +} + +void ItemConverter::FillSpecialItem( + USHORT nWhichId, SfxItemSet & rOutItemSet ) const +{ + OSL_ENSURE( false, "ItemConverter: Unhandled special item found!" ); +} + +bool ItemConverter::ApplySpecialItem( + USHORT nWhichId, const SfxItemSet & rItemSet ) const +{ + OSL_ENSURE( false, "ItemConverter: Unhandled special item found!" ); + return false; +} + +bool ItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) +{ + OSL_ASSERT( m_xPropertySet.is()); + + bool bItemsChanged = false; + SfxItemIter aIter( rItemSet ); + const SfxPoolItem * pItem = aIter.FirstItem(); + ::rtl::OUString aPropName; + uno::Any aValue; + + while( pItem ) + { + if( rItemSet.GetItemState( pItem->Which(), FALSE ) == SFX_ITEM_SET ) + { + if( GetItemPropertyName( pItem->Which(), aPropName )) + { + pItem->QueryValue( aValue, 0 /* nMemberId */ ); + + try + { + if( aValue != m_xPropertySet->getPropertyValue( aPropName )) + { + m_xPropertySet->setPropertyValue( aPropName, aValue ); + bItemsChanged = true; + } + } + catch( beans::UnknownPropertyException ex ) + { + OSL_ENSURE( false, U2C( ex.Message + C2U( " - unknown Property: " ) + aPropName ) ); + } + } + else + { + bItemsChanged = ApplySpecialItem( pItem->Which(), rItemSet ) || bItemsChanged; + } + } + pItem = aIter.NextItem(); + } + + return bItemsChanged; +} + +// ____ XEventListener ____ +void SAL_CALL ItemConverter::disposing( const lang::EventObject& Source ) + throw (uno::RuntimeException) +{ + if( Source.Source == m_xPropertySet ) + { + m_bIsValid = false; + } +} + +//static +void ItemConverter::InvalidateUnequalItems( SfxItemSet &rDestSet, const SfxItemSet &rSourceSet ) +{ + SfxWhichIter aIter (rSourceSet); + USHORT nWhich = aIter.FirstWhich (); + const SfxPoolItem *pPoolItem = NULL; + + while (nWhich) + { + if ((rSourceSet.GetItemState(nWhich, TRUE, &pPoolItem) == SFX_ITEM_SET) && + (rDestSet.GetItemState(nWhich, TRUE, &pPoolItem) == SFX_ITEM_SET)) + if (rSourceSet.Get(nWhich) != rDestSet.Get(nWhich)) + rDestSet.InvalidateItem(nWhich); + + nWhich = aIter.NextWhich (); + } +} + +} // namespace wrapper +} // namespace chart diff --git a/chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx b/chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx new file mode 100644 index 000000000000..a543df2f48d6 --- /dev/null +++ b/chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx @@ -0,0 +1,230 @@ +/************************************************************************* + * + * $RCSfile: MultipleItemConverter.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "MultipleItemConverter.hxx" +#include "ItemPropertyMap.hxx" +#include "SchSfxItemIds.hxx" +#include "SchWhichPairs.hxx" +#include "AxisItemConverter.hxx" +#include "GraphicPropertyItemConverter.hxx" +#include "DataPointItemConverter.hxx" +#include "ChartModelHelper.hxx" + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XAXISCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XAxisContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XGRIDCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XGridContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTDOCUMENT_HPP_ +#include <drafts/com/sun/star/chart2/XChartDocument.hpp> +#endif + +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +namespace chart +{ +namespace wrapper +{ +MultipleItemConverter::MultipleItemConverter( SfxItemPool& rItemPool ) + : ItemConverter( NULL, rItemPool ) +{ +} +MultipleItemConverter::~MultipleItemConverter() +{ + ::std::for_each( m_aConverters.begin(), m_aConverters.end(), + DeleteItemConverterPtr() ); +} + +void MultipleItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const +{ + ::std::vector< ItemConverter* >::const_iterator aIter = m_aConverters.begin(); + const ::std::vector< ItemConverter* >::const_iterator aEnd = m_aConverters.end(); + if( aIter != aEnd ) + { + (*aIter)->FillItemSet( rOutItemSet ); + aIter++; + } + for( ; aIter != aEnd; aIter++ ) + { + SfxItemSet aSet = this->CreateEmptyItemSet(); + (*aIter)->FillItemSet( aSet ); + InvalidateUnequalItems( rOutItemSet, aSet ); + } + // no own items +} + +bool MultipleItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) +{ + bool bResult = false; + + ::std::for_each( m_aConverters.begin(), m_aConverters.end(), + ApplyItemSetFunc( rItemSet, bResult )); + + // no own items + return bResult; +} + +//----------------------------------------------------------------------------- + +AllAxisItemConverter::AllAxisItemConverter( + const uno::Reference< frame::XModel > & xChartModel, + SfxItemPool& rItemPool, + SdrModel& rDrawModel ) + : MultipleItemConverter( rItemPool ) +{ + uno::Reference< chart2::XChartDocument > xChartDocument( xChartModel, uno::UNO_QUERY ); + if(!xChartDocument.is()) + return; + uno::Reference< chart2::XDiagram > xDiagram = xChartDocument->getDiagram(); + uno::Reference< chart2::XAxisContainer > xContainer( xDiagram, uno::UNO_QUERY ); + if(!xContainer.is()) + return; + uno::Sequence< uno::Reference< chart2::XAxis > > aElementList = xContainer->getAxes(); + for( sal_Int32 nA = 0; nA < aElementList.getLength(); nA++ ) + { + uno::Reference< beans::XPropertySet > xObjectProperties(aElementList[nA], uno::UNO_QUERY); + m_aConverters.push_back( new wrapper::AxisItemConverter( + xObjectProperties, rItemPool, rDrawModel, 0, 0, 0, 0 ) ); + } +} + +AllAxisItemConverter::~AllAxisItemConverter() +{ +} + +const USHORT * AllAxisItemConverter::GetWhichPairs() const +{ + // must span all used items! + return nAllAxisWhichPairs; +} + +//----------------------------------------------------------------------------- + +AllGridItemConverter::AllGridItemConverter( + const uno::Reference< frame::XModel > & xChartModel, + SfxItemPool& rItemPool, + SdrModel& rDrawModel ) + : MultipleItemConverter( rItemPool ) +{ + uno::Reference< chart2::XChartDocument > xChartDocument( xChartModel, uno::UNO_QUERY ); + if(!xChartDocument.is()) + return; + uno::Reference< chart2::XDiagram > xDiagram = xChartDocument->getDiagram(); + uno::Reference< chart2::XGridContainer > xContainer( xDiagram, uno::UNO_QUERY ); + if(!xContainer.is()) + return; + uno::Sequence< uno::Reference< chart2::XGrid > > aElementList = xContainer->getGrids(); + for( sal_Int32 nA = 0; nA < aElementList.getLength(); nA++ ) + { + uno::Reference< beans::XPropertySet > xObjectProperties(aElementList[nA], uno::UNO_QUERY); + m_aConverters.push_back( new wrapper::GraphicPropertyItemConverter( + xObjectProperties, rItemPool, rDrawModel, + wrapper::GraphicPropertyItemConverter::LINE_PROPERTIES ) ); + } +} + +AllGridItemConverter::~AllGridItemConverter() +{ +} + +const USHORT * AllGridItemConverter::GetWhichPairs() const +{ + // must span all used items! + return nGridWhichPairs; +} + +//----------------------------------------------------------------------------- + +AllDataLabelItemConverter::AllDataLabelItemConverter( + const uno::Reference< frame::XModel > & xChartModel, + SfxItemPool& rItemPool, + SdrModel& rDrawModel ) + : MultipleItemConverter( rItemPool ) +{ + ::std::vector< uno::Reference< chart2::XDataSeries > > aSeriesList( + ChartModelHelper::getDataSeries( xChartModel )); + + ::std::vector< uno::Reference< chart2::XDataSeries > >::const_iterator aIt; + for( aIt = aSeriesList.begin(); aIt != aSeriesList.end(); ++aIt ) + { + uno::Reference< beans::XPropertySet > xObjectProperties( *aIt, uno::UNO_QUERY); + m_aConverters.push_back( new wrapper::DataPointItemConverter( + xObjectProperties, rItemPool, rDrawModel, NULL ) ); + } +} + +AllDataLabelItemConverter::~AllDataLabelItemConverter() +{ +} + +const USHORT * AllDataLabelItemConverter::GetWhichPairs() const +{ + // must span all used items! + return nDataLabelWhichPairs; +} + +//----------------------------------------------------------------------------- + +} // namespace wrapper +} // namespace chart diff --git a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx new file mode 100644 index 000000000000..38e82aa2d1de --- /dev/null +++ b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx @@ -0,0 +1,273 @@ +/************************************************************************* + * + * $RCSfile: SchWhichPairs.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_SCHWHICHPAIRS_HXX +#define CHART_SCHWHICHPAIRS_HXX + +#ifndef _SVX_SVXIDS_HRC +#include <svx/svxids.hrc> +#endif + +#ifndef _XDEF_HXX +#include <svx/xdef.hxx> +#endif +#ifndef _SVDDEF_HXX +#include <svx/svddef.hxx> +#endif +#ifndef _EEITEM_HXX +#include <svx/eeitem.hxx> +#endif + +#include "SchSfxItemIds.hxx" +#include "SchSlotIds.hxx" + +namespace +{ + +const USHORT nTitleWhichPairs[] = +{ +// SCHATTR_TEXT_ORIENT, SCHATTR_TEXT_ORIENT, // 4 sch/schattr.hxx + SCHATTR_TEXT_STACKED, SCHATTR_TEXT_STACKED, // 4 sch/schattr.hxx + SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx + SCHATTR_USER_DEFINED_ATTR, SCHATTR_USER_DEFINED_ATTR, // 100 sch/schattr.hxx + XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx + XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx + SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, // 1067 - 1078 svx/svddef.hxx + EE_ITEMS_START, EE_ITEMS_END, // 3994 - 4037 svx/eeitem.hxx + 0 +}; + +const USHORT nAxisWhichPairs[] = +{ + XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx + EE_ITEMS_START, EE_ITEMS_END, // 3994 - 4037 svx/eeitem.hxx + SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE, // 10585 - 10585 svx/svxids.hrc + SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE, // 11432 svx/svxids.hrc + SCHATTR_AXISTYPE, SCHATTR_AXISTYPE, // 39 sch/schattr.hxx + SCHATTR_TEXT_START, SCHATTR_TEXT_END, // 4 - 6 sch/schattr.hxx + SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx + SCHATTR_TEXT_OVERLAP, SCHATTR_TEXT_OVERLAP, // 54 sch/schattr.hxx + SCHATTR_AXIS_START, SCHATTR_AXIS_END, // 70 - 95 sch/schattr.hxx + SCHATTR_USER_DEFINED_ATTR, SCHATTR_USER_DEFINED_ATTR, // 100 sch/schattr.hxx + // SID_TEXTBREAK, SID_TEXTBREAK, // 30587 sch/app.hrc + SCHATTR_TEXTBREAK, SCHATTR_TEXTBREAK, // 30587 sch/schattr.hxx + 0 +}; + +const USHORT nAllAxisWhichPairs[] = +{ + XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx + EE_ITEMS_START, EE_ITEMS_END, // 3994 - 4037 svx/eeitem.hxx +// SCHATTR_TEXT_ORIENT, SCHATTR_TEXT_ORIENT, // 4 sch/schattr.hxx + SCHATTR_TEXT_START, SCHATTR_TEXT_END, // 4 - 6 sch/schattr.hxx + SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx + SCHATTR_TEXT_OVERLAP, SCHATTR_TEXT_OVERLAP, // 54 sch/schattr.hxx + SCHATTR_AXIS_SHOWDESCR, SCHATTR_AXIS_SHOWDESCR, // 85 sch/schattr.hxx + // SID_TEXTBREAK, SID_TEXTBREAK, // 30587 sch/app.hrc + SCHATTR_TEXTBREAK, SCHATTR_TEXTBREAK, // 30587 sch/schattr.hxx + 0 +}; + +const USHORT nGridWhichPairs[] = +{ + XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx + SCHATTR_USER_DEFINED_ATTR, SCHATTR_USER_DEFINED_ATTR, // 100 sch/schattr.hxx + 0 +}; + +const USHORT nChartWhichPairs[] = +{ + SCHATTR_STYLE_START,SCHATTR_STYLE_END, // 59 - 68 sch/schattr.hxx + SCHATTR_USER_DEFINED_ATTR, SCHATTR_USER_DEFINED_ATTR, // 100 sch/schattr.hxx + 0 +}; + +const USHORT nDiagramAreaWhichPairs[] = +{ + XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx + XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx + SCHATTR_USER_DEFINED_ATTR, SCHATTR_USER_DEFINED_ATTR, // 100 sch/schattr.hxx + 0 +}; + +const USHORT nAreaAndChartWhichPairs[] = // pairs for chart AND area +{ + XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx + XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx + SCHATTR_STYLE_START,SCHATTR_STYLE_END, // 59 - 68 sch/schattr.hxx + SCHATTR_USER_DEFINED_ATTR, SCHATTR_USER_DEFINED_ATTR, // 100 sch/schattr.hxx + 0 +}; + +const USHORT nLegendWhichPairs[] = +{ + XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx + XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1018 - 1046 svx/xdef.hxx + SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, // 1067 - 1078 svx/svddef.hxx + EE_ITEMS_START, EE_ITEMS_END, // 3994 - 4037 svx/eeitem.hxx + SCHATTR_LEGEND_START, SCHATTR_LEGEND_END, // 3 - 3 sch/schattr.hxx + SCHATTR_USER_DEFINED_ATTR, SCHATTR_USER_DEFINED_ATTR, // 100 sch/schattr.hxx + 0 +}; + +const USHORT nDataLabelWhichPairs[] = +{ + SCHATTR_DATADESCR_START, SCHATTR_DATADESCR_END, + 0 +}; + +#define CHART_ROW_WHICHPAIRS \ + XATTR_LINE_FIRST, XATTR_LINE_LAST, /* 1000 - 1016 svx/xdef.hxx */ \ + XATTR_FILL_FIRST, XATTR_FILL_LAST, /* 1018 - 1046 svx/xdef.hxx */ \ + EE_ITEMS_START, EE_ITEMS_END, /* 3994 - 4037 svx/eeitem.hxx */ \ + SCHATTR_DATADESCR_START, SCHATTR_DATADESCR_END, /* 1 - 2 sch/schattr.hxx*/ \ + SCHATTR_DUMMY0, SCHATTR_DUMMY0, /* 40 sch/schattr.hxx*/ \ + SCHATTR_DUMMY1, SCHATTR_DUMMY1, /* 41 sch/schattr.hxx*/ \ + SCHATTR_STAT_START, SCHATTR_STAT_END, /* 45 - 52 sch/schattr.hxx*/ \ + SCHATTR_STYLE_START,SCHATTR_STYLE_END, /* 59 - 68 sch/schattr.hxx*/ \ + SCHATTR_AXIS,SCHATTR_AXIS, /* 69 sch/schattr.hxx*/ \ + SCHATTR_SYMBOL_BRUSH,SCHATTR_SYMBOL_BRUSH, /* 96 sch/schattr.hxx*/ \ + SCHATTR_SYMBOL_SIZE,SCHATTR_USER_DEFINED_ATTR, /* 99 - 100 sch/schattr.hxx*/ \ + SDRATTR_3D_FIRST, SDRATTR_3D_LAST /* 1244 - 1334 svx/svddef.hxx */ + +const USHORT nRowWhichPairs[] = +{ + CHART_ROW_WHICHPAIRS, + 0 +}; + +const USHORT nAreaWhichPairs[] = +{ + XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx + XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1000 - 1016 svx/xdef.hxx + SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, // 1067 - 1078 svx/svddef.hxx + SCHATTR_USER_DEFINED_ATTR, SCHATTR_USER_DEFINED_ATTR, // 100 sch/schattr.hxx + 0 +}; + +const USHORT nTextWhichPairs[] = +{ + EE_ITEMS_START, EE_ITEMS_END, // 3994 - 4037 svx/eeitem.hxx +// SCHATTR_TEXT_ORIENT, SCHATTR_TEXT_ORIENT, // 4 sch/schattr.hxx + SCHATTR_TEXT_STACKED, SCHATTR_TEXT_STACKED, // 4 sch/schattr.hxx + SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx + SCHATTR_USER_DEFINED_ATTR, SCHATTR_USER_DEFINED_ATTR, // 100 sch/schattr.hxx + 0 +}; + +const USHORT nTextOrientWhichPairs[] = +{ + EE_ITEMS_START, EE_ITEMS_END, // 3994 - 4037 svx/eeitem.hxx +// SCHATTR_TEXT_ORIENT, SCHATTR_TEXT_ORIENT, // 4 sch/schattr.hxx + SCHATTR_TEXT_STACKED, SCHATTR_TEXT_STACKED, // 4 sch/schattr.hxx + SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES, // 53 sch/schattr.hxx + 0 +}; + +const USHORT nStatWhichPairs[]= +{ + SCHATTR_STAT_START, SCHATTR_STAT_END, // 45 - 52 sch/schattr.hxx + 0 +}; + +// for CharacterProperties + +const USHORT nCharacterPropertyWhichPairs[] = +{ + EE_ITEMS_START, EE_ITEMS_END, // 3994 - 4037 svx/eeitem.hxx + 0 +}; + +const USHORT nLinePropertyWhichPairs[] = +{ + XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx + 0 +}; + +const USHORT nFillPropertyWhichPairs[] = +{ + XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1000 - 1016 svx/xdef.hxx + SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, // 1067 - 1078 svx/svddef.hxx + 0 +}; + +const USHORT nLineAndFillPropertyWhichPairs[] = +{ + XATTR_LINE_FIRST, XATTR_LINE_LAST, // 1000 - 1016 svx/xdef.hxx + XATTR_FILL_FIRST, XATTR_FILL_LAST, // 1000 - 1016 svx/xdef.hxx + SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, // 1067 - 1078 svx/svddef.hxx + 0 +}; + +const USHORT nChartStyleWhichPairs[] = +{ + SCHATTR_DIAGRAM_STYLE, SCHATTR_DIAGRAM_STYLE, + SCHATTR_STYLE_SHAPE, SCHATTR_STYLE_SHAPE, + SCHATTR_NUM_OF_LINES_FOR_BAR, SCHATTR_NUM_OF_LINES_FOR_BAR, + SCHATTR_SPLINE_ORDER, SCHATTR_SPLINE_ORDER, + SCHATTR_SPLINE_RESOLUTION, SCHATTR_SPLINE_RESOLUTION, + 0 +}; + + +} // anonymous namespace + +// CHART_SCHWHICHPAIRS_HXX +#endif diff --git a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx new file mode 100644 index 000000000000..b8818f2b89ae --- /dev/null +++ b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx @@ -0,0 +1,262 @@ +/************************************************************************* + * + * $RCSfile: TitleItemConverter.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "TitleItemConverter.hxx" +#include "SchWhichPairs.hxx" +#include "macros.hxx" +#include "ItemPropertyMap.hxx" +#include "GraphicPropertyItemConverter.hxx" +#include "CharacterPropertyItemConverter.hxx" +#include "MultipleItemConverter.hxx" + +#ifndef _SFXINTITEM_HXX +#include <svtools/intitem.hxx> +#endif +#ifndef INCLUDED_RTL_MATH_HXX +#include <rtl/math.hxx> +#endif + +#include <drafts/com/sun/star/chart2/XTitled.hpp> + +#include <functional> +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +namespace +{ +::chart::wrapper::ItemPropertyMapType & lcl_GetTitlePropertyMap() +{ + static ::chart::wrapper::ItemPropertyMapType aTitlePropertyMap( + ::chart::wrapper::MakeItemPropertyMap + ( SCHATTR_TEXT_STACKED, C2U( "StackCharacters" )) + ); + + return aTitlePropertyMap; +}; +} // anonymous namespace + +namespace chart +{ +namespace wrapper +{ + +// ======================================== + +class FormattedStringsConverter : public MultipleItemConverter +{ +public: + FormattedStringsConverter( + const uno::Sequence< uno::Reference< chart2::XFormattedString > > & aStrings, + SfxItemPool & rItemPool ); + virtual ~FormattedStringsConverter(); + +protected: + virtual const USHORT * GetWhichPairs() const; +}; + +// ---------------------------------------- + +FormattedStringsConverter::FormattedStringsConverter( + const uno::Sequence< uno::Reference< chart2::XFormattedString > > & aStrings, + SfxItemPool & rItemPool ) + : MultipleItemConverter( rItemPool ) +{ + for( sal_Int32 i = 0; i < aStrings.getLength(); ++i ) + { + uno::Reference< beans::XPropertySet > xProp( aStrings[ i ], uno::UNO_QUERY ); + if( xProp.is()) + m_aConverters.push_back( new CharacterPropertyItemConverter( xProp, rItemPool )); + } +} + +FormattedStringsConverter::~FormattedStringsConverter() +{ +} + +const USHORT * FormattedStringsConverter::GetWhichPairs() const +{ + return nCharacterPropertyWhichPairs; +} + +// ======================================== + +TitleItemConverter::TitleItemConverter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropertySet, + SfxItemPool& rItemPool, + SdrModel& rDrawModel ) : + ItemConverter( rPropertySet, rItemPool ) +{ + m_aConverters.push_back( new GraphicPropertyItemConverter( + rPropertySet, rItemPool, rDrawModel, + GraphicPropertyItemConverter::LINE_AND_FILL_PROPERTIES )); + + // CharacterProperties are not at the title but at its contained XFormattedString objects + // take the first formatted string in the sequence + uno::Reference< chart2::XTitle > xTitle( rPropertySet, uno::UNO_QUERY ); + if( xTitle.is()) + { + uno::Sequence< uno::Reference< chart2::XFormattedString > > aStringSeq( xTitle->getText()); + if( aStringSeq.getLength() > 0 ) + { + m_aConverters.push_back( new FormattedStringsConverter( aStringSeq, rItemPool )); + } + } +} + +TitleItemConverter::~TitleItemConverter() +{ + ::std::for_each( m_aConverters.begin(), m_aConverters.end(), + DeleteItemConverterPtr() ); +} + +void TitleItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const +{ + ::std::for_each( m_aConverters.begin(), m_aConverters.end(), + FillItemSetFunc( rOutItemSet )); + + // own items + ItemConverter::FillItemSet( rOutItemSet ); +} + +bool TitleItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) +{ + bool bResult = false; + + ::std::for_each( m_aConverters.begin(), m_aConverters.end(), + ApplyItemSetFunc( rItemSet, bResult )); + + // own items + return ItemConverter::ApplyItemSet( rItemSet ) || bResult; +} + +const USHORT * TitleItemConverter::GetWhichPairs() const +{ + // must span all used items! + return nTitleWhichPairs; +} + +bool TitleItemConverter::GetItemPropertyName( USHORT nWhichId, ::rtl::OUString & rOutName ) const +{ + ItemPropertyMapType & rMap( lcl_GetTitlePropertyMap()); + ItemPropertyMapType::const_iterator aIt( rMap.find( nWhichId )); + + if( aIt == rMap.end()) + return false; + + rOutName =(*aIt).second; + return true; +} + + +bool TitleItemConverter::ApplySpecialItem( + USHORT nWhichId, const SfxItemSet & rItemSet ) const +{ + bool bChanged = false; + + switch( nWhichId ) + { + case SCHATTR_TEXT_DEGREES: + { + // convert int to double (divided by 100) + double fVal = static_cast< double >( + reinterpret_cast< const SfxInt32Item & >( + rItemSet.Get( nWhichId )).GetValue()) / 100.0; + double fOldVal = 0.0; + bool bPropExisted = + ( GetPropertySet()->getPropertyValue( C2U( "TextRotation" )) >>= fOldVal ); + + if( ! bPropExisted || + ( bPropExisted && fOldVal != fVal )) + { + GetPropertySet()->setPropertyValue( C2U( "TextRotation" ), uno::makeAny( fVal )); + bChanged = true; + } + } + break; + } + + return bChanged; +} + +void TitleItemConverter::FillSpecialItem( + USHORT nWhichId, SfxItemSet & rOutItemSet ) const +{ + switch( nWhichId ) + { + case SCHATTR_TEXT_DEGREES: + { + // convert double to int (times 100) + double fVal; + + if( GetPropertySet()->getPropertyValue( C2U( "TextRotation" )) >>= fVal ) + { + rOutItemSet.Put( SfxInt32Item( nWhichId, static_cast< sal_Int32 >( + ::rtl::math::round( fVal * 100.0 ) ) )); + } + } + break; + } +} + +} // namespace wrapper +} // namespace chart diff --git a/chart2/source/controller/itemsetwrapper/makefile.mk b/chart2/source/controller/itemsetwrapper/makefile.mk new file mode 100644 index 000000000000..d7b6e2cd1661 --- /dev/null +++ b/chart2/source/controller/itemsetwrapper/makefile.mk @@ -0,0 +1,89 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* +PRJ= ..$/..$/.. +PRJINC= $(PRJ)$/source +PRJNAME= chart2 +TARGET= chcitemsetwrapper + +ENABLE_EXCEPTIONS= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: settings.mk + +# --- export library ------------------------------------------------- + +#object files to build and link together to lib $(SLB)$/$(TARGET).lib +SLOFILES= $(SLO)$/SchItemPool.obj \ + $(SLO)$/ItemConverter.obj \ + $(SLO)$/AxisItemConverter.obj \ + $(SLO)$/MultipleItemConverter.obj \ + $(SLO)$/CharacterPropertyItemConverter.obj \ + $(SLO)$/ChartTypeItemConverter.obj \ + $(SLO)$/DataPointItemConverter.obj \ + $(SLO)$/GraphicPropertyItemConverter.obj \ + $(SLO)$/TitleItemConverter.obj + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk + diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx new file mode 100644 index 000000000000..c6b5e19bac43 --- /dev/null +++ b/chart2/source/controller/main/ChartController.cxx @@ -0,0 +1,1124 @@ +/************************************************************************* + * + * $RCSfile: ChartController.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ChartController.hxx" +#include "servicenames.hxx" + +#include "InlineContainer.hxx" +#include "Chart.hrc" +#include "ResId.hxx" +#include "SchSlotIds.hxx" + +#include "chartview/ChartView.hxx" +#include "ChartWindow.hxx" +#include "DrawModelWrapper.hxx" +#include "DrawViewWrapper.hxx" + +#include "macros.hxx" + +#include "chartview/NumberFormatterWrapper.hxx" + +#include "dlg_ChartType.hxx" +#include "ChartTypeItemConverter.hxx" + +//for SID_CHARMAP: +#ifndef _SVX_SVXIDS_HRC +#include <svx/svxids.hrc> +#endif + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTDOCUMENT_HPP_ +#include <drafts/com/sun/star/chart2/XChartDocument.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XSTACKABLESCALEGROUP_HPP_ +#include <drafts/com/sun/star/chart2/XStackableScaleGroup.hpp> +#endif + +//------- +// header for define RET_OK +#ifndef _SV_MSGBOX_HXX +#include <vcl/msgbox.hxx> +#endif +//------- + +//------- +#ifndef _TOOLKIT_AWT_VCLXWINDOW_HXX_ +#include <toolkit/awt/vclxwindow.hxx> +#endif +#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ +#include <toolkit/helper/vclunohelper.hxx> +#endif +#ifndef _VOS_MUTEX_HXX_ +#include <vos/mutex.hxx> +#endif +//------- +#ifndef _COMPHELPER_PROCESSFACTORY_HXX_ +#include <comphelper/processfactory.hxx> +#endif +#ifndef _COM_SUN_STAR_UTIL_XURLTRANSFORMER_HPP_ +#include <com/sun/star/util/XURLTransformer.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +//----------------------------------------------------------------- +// ChartController Constructor and Destructor +//----------------------------------------------------------------- + +ChartController::ChartController(uno::Reference<uno::XComponentContext> const & xContext) + : m_aLifeTimeManager( NULL ) + , m_xFrame( NULL ) + , m_aModelMutex() + , m_aModel( NULL, m_aModelMutex ) + , m_bSuspended( sal_False ) + , m_bCanClose( sal_True ) + , m_pChartWindow( NULL ) + , m_xViewWindow( NULL ) + , m_pChartView( NULL ) + , m_pDrawModelWrapper( NULL ) + , m_pDrawViewWrapper(NULL) + , m_xCC(xContext) //@todo is it allowed to hold this context?? + , m_bViewDirty( false ) + , m_pNumberFormatterWrapper(NULL) +{ + + //@todo + m_pNumberFormatterWrapper = new NumberFormatterWrapper(); +} + +ChartController::~ChartController() +{ + impl_deleteView(); + //m_pChartWindow is deleted via UNO by Window hierarchy or Framework + if(m_pNumberFormatterWrapper) + delete m_pNumberFormatterWrapper; + + //@todo ? +} + +//----------------------------------------------------------------- + +ChartController::RefCountable::RefCountable() : m_nRefCount(0) +{ +} + +ChartController::RefCountable::~RefCountable() +{ +} +void ChartController::RefCountable::acquire() +{ + m_nRefCount++; +} +void ChartController::RefCountable::release() +{ + m_nRefCount--; + if(!m_nRefCount) + delete this; +} + +//----------------------------------------------------------------- + +ChartController::TheModel::TheModel( const uno::Reference< frame::XModel > & xModel ) + : m_xModel( xModel ) + , m_xCloseable( NULL ) + , m_bOwnership( sal_True ) + , m_bOwnershipIsWellKnown( sal_False ) +{ + m_xCloseable = + uno::Reference< util::XCloseable >( xModel, uno::UNO_QUERY ); +} + +ChartController::TheModel::~TheModel() +{ +} + +void ChartController::TheModel::SetOwnerShip( sal_Bool bGetsOwnership ) +{ + m_bOwnership = bGetsOwnership; + m_bOwnershipIsWellKnown = sal_True; +} + +void ChartController::TheModel::addListener( ChartController* pController ) +{ + if(m_xCloseable.is()) + { + //if you need to be able to veto against the destruction of the model + // you must add as a close listener + + //otherwise you 'can' add as closelistener or 'must' add as dispose event listener + + m_xCloseable->addCloseListener( + static_cast<util::XCloseListener*>(pController) ); + } + else if( m_xModel.is() ) + { + //we need to add as dispose event listener + m_xModel->addEventListener( + static_cast<lang::XEventListener*>(pController) ); + } + +} + +void ChartController::TheModel::removeListener( ChartController* pController ) +{ + if(m_xCloseable.is()) + m_xCloseable->removeCloseListener( + static_cast<util::XCloseListener*>(pController) ); + + else if( m_xModel.is() ) + m_xModel->removeEventListener( + static_cast<lang::XEventListener*>(pController) ); +} + +void ChartController::TheModel::tryTermination() +{ + if(!m_bOwnership) + return; + + try + { + if(m_xCloseable.is()) + { + try + { + //@todo ? are we allowed to use sal_True here if we have the explicit ownership? + //I think yes, because there might be other closelistners later in the list which might be interested still + //but make sure that we do not throw the CloseVetoException here ourselfs + //so stop listening before trying to terminate or check the source of queryclosing event + m_xCloseable->close(sal_True); + + m_bOwnership = false; + m_bOwnershipIsWellKnown = sal_True; + } + catch( util::CloseVetoException& ) + { + //since we have indicated to give up the ownership with paramter true in close call + //the one who has thrown the CloseVetoException is the new owner + + OSL_ENSURE( !m_bOwnership, + "INFO: a well known owner has catched a CloseVetoException after calling close(true)" ); + + m_bOwnership = false; + m_bOwnershipIsWellKnown = sal_True; + return; + } + + } + else if( m_xModel.is() ) + { + //@todo correct?? + m_xModel->dispose(); + return; + } + } + catch( uno::Exception& ex) + { + OSL_ENSURE( sal_False, ( rtl::OString("Termination of model failed: ") + + rtl::OUStringToOString( ex.Message, RTL_TEXTENCODING_ASCII_US ) ).getStr() ); + } +} + +//----------------------------------------------------------------- + +ChartController::TheModelRef::TheModelRef( TheModel* pTheModel, ::osl::Mutex& rMutex ) + : m_pTheModel(pTheModel), m_rModelMutex(rMutex) +{ + ::osl::Guard< ::osl::Mutex > aGuard( m_rModelMutex ); + if(m_pTheModel) + m_pTheModel->acquire(); +} +ChartController::TheModelRef::TheModelRef( const TheModelRef& rTheModel, ::osl::Mutex& rMutex ) + : m_rModelMutex(rMutex) +{ + ::osl::Guard< ::osl::Mutex > aGuard( m_rModelMutex ); + m_pTheModel=rTheModel.operator->(); + if(m_pTheModel) + m_pTheModel->acquire(); +} +ChartController::TheModelRef& ChartController::TheModelRef::operator=(TheModel* pTheModel) +{ + ::osl::Guard< ::osl::Mutex > aGuard( m_rModelMutex ); + if(m_pTheModel==pTheModel) + return *this; + if(m_pTheModel) + m_pTheModel->release(); + m_pTheModel=pTheModel; + if(m_pTheModel) + m_pTheModel->acquire(); + return *this; +} +ChartController::TheModelRef& ChartController::TheModelRef::operator=(const TheModelRef& rTheModel) +{ + ::osl::Guard< ::osl::Mutex > aGuard( m_rModelMutex ); + TheModel* pNew=rTheModel.operator->(); + if(m_pTheModel==pNew) + return *this; + if(m_pTheModel) + m_pTheModel->release(); + m_pTheModel=pNew; + if(m_pTheModel) + m_pTheModel->acquire(); + return *this; +} +ChartController::TheModelRef::~TheModelRef() +{ + ::osl::Guard< ::osl::Mutex > aGuard( m_rModelMutex ); + if(m_pTheModel) + m_pTheModel->release(); +} +sal_Bool ChartController::TheModelRef::is() const +{ + return (m_pTheModel != 0); +} + + +//----------------------------------------------------------------- +// private methods +//----------------------------------------------------------------- + + sal_Bool ChartController +::impl_isDisposedOrSuspended() +{ + if( m_aLifeTimeManager.impl_isDisposed() ) + return sal_True; + + if( m_bSuspended ) + { + OSL_ENSURE( sal_False, "This Controller is suspended" ); + return sal_True; + } + return sal_False; +} + +//----------------------------------------------------------------- +// lang::XServiceInfo +//----------------------------------------------------------------- + +APPHELPER_XSERVICEINFO_IMPL(ChartController,CHART_CONTROLLER_SERVICE_IMPLEMENTATION_NAME) + + uno::Sequence< rtl::OUString > ChartController +::getSupportedServiceNames_Static() +{ + uno::Sequence< rtl::OUString > aSNS( 2 ); + aSNS.getArray()[ 0 ] = CHART_CONTROLLER_SERVICE_NAME; + aSNS.getArray()[ 1 ] = ::rtl::OUString::createFromAscii("com.sun.star.frame.Controller"); + //// @todo : add additional services if you support any further + return aSNS; +} + +//----------------------------------------------------------------- +// XController +//----------------------------------------------------------------- + + void SAL_CALL ChartController +::attachFrame( const uno::Reference<frame::XFrame>& xFrame ) + throw(uno::RuntimeException) +{ + osl::Guard< osl::Mutex > aGuard( m_aControllerMutex ); + + if( impl_isDisposedOrSuspended() ) //@todo? allow attaching the frame while suspended? + return; //behave passive if already disposed or suspended + + if(m_xFrame.is()) //what happens, if we do have a Frame already?? + { + //@todo? throw exception? + OSL_ENSURE( sal_False, "there is already a frame attached to the controller" ); + return; + } + + //--attach frame + m_xFrame = xFrame; //the frameloader is responsible to call xFrame->setComponent + + //add as disposelistener to the frame (due to persistent reference) ??...: + + //the frame is considered to be owner of this controller and will live longer than we do + //the frame or the disposer of the frame has the duty to call suspend and dispose on this object + //so we do not need to add as lang::XEventListener for DisposingEvents right? + + //@todo nothing right??? + + + + //-------------------------------------------------- + //create view @todo is this the correct place here?? + + Window* pParent = NULL; + //get the window parent from the frame to use as parent for our new window + if(xFrame.is()) + { + uno::Reference< awt::XWindow > xContainerWindow = xFrame->getContainerWindow(); + VCLXWindow* pParentComponent = VCLXWindow::GetImplementation(xContainerWindow); + pParentComponent->setVisible(sal_True); + + pParent = VCLUnoHelper::GetWindow( xContainerWindow ); + } + + if(m_pChartWindow) + { + //@todo delete ... + } + { + // calls to VCL + ::vos::OGuard aSolarGuard( Application::GetSolarMutex()); + m_pChartWindow = new ChartWindow(this,pParent,pParent?pParent->GetStyle():0); + m_xViewWindow = uno::Reference< awt::XWindow >( m_pChartWindow->GetComponentInterface(), uno::UNO_QUERY ); + m_pChartWindow->Show(); + } + + impl_tryInitializeView(); + + {//create the menu + util::URL aURL( SchResId(RID_MENU).getURL() ); + + uno::Reference< lang::XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory(); + uno::Reference< util::XURLTransformer > xTrans( + xMgr->createInstance( ::rtl::OUString::createFromAscii( + "com.sun.star.util.URLTransformer") ), uno::UNO_QUERY ); + if( xTrans.is() ) + { + // Datei laden + xTrans->parseStrict( aURL ); + + uno::Reference< frame::XDispatchProvider > xProv( xFrame, uno::UNO_QUERY ); + if ( xProv.is() ) + { + uno::Reference< frame::XDispatch > aDisp = + xProv->queryDispatch( aURL, + ::rtl::OUString::createFromAscii("_menubar"), 12 ); + if ( aDisp.is() ) + aDisp->dispatch( aURL, uno::Sequence<beans::PropertyValue>() ); + } + } + } +} + +void SAL_CALL ChartController +::impl_rebuildView() + throw(uno::RuntimeException) +{ + m_bViewDirty = false; + impl_deleteView(); + impl_tryInitializeView(); + if( m_aSelectedObjectCID.getLength() ) + { + //@todo reselect object + m_aSelectedObjectCID = C2U(""); + } +} + +void SAL_CALL ChartController +::impl_deleteView() + throw(uno::RuntimeException) +{ + delete m_pChartView; m_pChartView = NULL; + delete m_pDrawViewWrapper; m_pDrawViewWrapper = NULL; + delete m_pDrawModelWrapper; m_pDrawModelWrapper = NULL; +} + + sal_Bool SAL_CALL ChartController +::impl_tryInitializeView() + throw(uno::RuntimeException) +{ + osl::ClearableGuard< osl::Mutex > aGuard( m_aControllerMutex ); + if(!m_pChartWindow || !m_aModel.is() ) + return sal_False; + + m_pDrawModelWrapper = new DrawModelWrapper(m_xCC + ,wrapper::ItemConverter::CreateSchItemPool()); + + uno::Reference< frame::XModel > xDrawModel = m_pDrawModelWrapper->getUnoModel(); + if( xDrawModel.is()) + xDrawModel->lockControllers(); + + m_pChartView = ChartView::createView( m_xCC, m_aModel->getModel() + , uno::Reference<drawing::XDrawPagesSupplier>::query( xDrawModel ) + , m_pNumberFormatterWrapper ); + //OutputDevice* pOutDev = m_pDrawViewWrapper->GetWin(0); + Size aPageSize = m_pChartWindow->GetOutputSize(); + m_pChartView->create( awt::Size( aPageSize.Width(), aPageSize.Height() ) ); +// m_pChartWindow->SetChartView(m_pChartView);//enable event flow from window to View (Window knows View) + + //create draw view: + m_pDrawViewWrapper = new DrawViewWrapper(&m_pDrawModelWrapper->getSdrModel(),m_pChartWindow); + //test: + //Rectangle aTest = m_pDrawViewWrapper->GetWorkArea(); + //m_pDrawViewWrapper->SetWorkArea(pOutDev->PixelToLogic(Rectangle(rOfs, rSize))); + + if( xDrawModel.is()) + { + xDrawModel->unlockControllers(); + m_pChartWindow->Invalidate(); + } + return sal_True; +} + + sal_Bool SAL_CALL ChartController +::attachModel( const uno::Reference< frame::XModel > & xModel ) + throw(uno::RuntimeException) +{ + //is called to attach the controller to a new model. + //return true if attach was successfully, false otherwise (e.g. if you do not work with a model) + + osl::ClearableGuard< osl::Mutex > aGuard( m_aControllerMutex ); + if( impl_isDisposedOrSuspended() ) //@todo? allow attaching a new model while suspended? + return sal_False; //behave passive if already disposed or suspended + aGuard.clear(); + + + TheModelRef aNewModelRef( new TheModel( xModel), m_aModelMutex); + TheModelRef aOldModelRef(m_aModel,m_aModelMutex); + m_aModel = aNewModelRef; + + //--handle relations to the old model if any + if( aOldModelRef.is() ) + { + aOldModelRef->removeListener( this ); + //@todo?? termination correct? + aOldModelRef->tryTermination(); + } + + //--handle relations to the new model + aNewModelRef->addListener( this ); + + //the frameloader is responsible to call xModel->connectController + + { + // Indirect calls to VCL + ::vos::OGuard aSolarGuard( Application::GetSolarMutex()); + impl_tryInitializeView(); + } + + return sal_True; +} + + uno::Reference< frame::XFrame > SAL_CALL ChartController +::getFrame() throw(uno::RuntimeException) +{ + //provides access to owner frame of this controller + //return the frame containing this controller + + return m_xFrame; +} + + uno::Reference< frame::XModel > SAL_CALL ChartController +::getModel() throw(uno::RuntimeException) +{ + //provides access to currently attached model + //returns the currently attached model + + //return nothing, if you do not have a model + TheModelRef aModelRef( m_aModel, m_aModelMutex); + if(aModelRef.is()) + return aModelRef->getModel(); + + return uno::Reference< frame::XModel > (); +} + + uno::Any SAL_CALL ChartController +::getViewData() throw(uno::RuntimeException) +{ + //provides access to current view status + //set of data that can be used to restore the current view status at later time + // by using XController::restoreViewData() + + osl::ResettableGuard< osl::Mutex > aGuard( m_aControllerMutex ); + if( impl_isDisposedOrSuspended() ) + return uno::Any(); //behave passive if already disposed or suspended //@todo? or throw an exception?? + + //-- collect current view state + uno::Any aRet; + //// @todo integrate specialized implementation + + return aRet; +} + + void SAL_CALL ChartController +::restoreViewData( const uno::Any& Value ) + throw(uno::RuntimeException) +{ + //restores the view status using the data gotten from a previous call to XController::getViewData() + + osl::ResettableGuard< osl::Mutex > aGuard( m_aControllerMutex ); + if( impl_isDisposedOrSuspended() ) + return; //behave passive if already disposed or suspended //@todo? or throw an exception?? + + //// @todo integrate specialized implementation +} + + sal_Bool SAL_CALL ChartController +::suspend( sal_Bool bSuspend ) + throw(uno::RuntimeException) +{ + //is called to prepare the controller for closing the view + //bSuspend==true: force the controller to suspend his work + //bSuspend==false try to reactivate the controller + //returns true if request was accepted and of course successfully finished, false otherwise + + //we may show dialogs here to ask the user for saving changes ... @todo? + + osl::ResettableGuard< osl::Mutex > aGuard( m_aControllerMutex ); + if( m_aLifeTimeManager.impl_isDisposed() ) + return sal_False; //behave passive if already disposed, return false because request was not accepted //@todo? correct + + if(bSuspend==m_bSuspended) + { + OSL_ENSURE( sal_False, "new suspend mode equals old suspend mode" ); + //@todo ??? or return true in this case? + return sal_False; + } + + //change suspend mode + if(bSuspend) + { + //aGuard.clear(); + //@todo ??? try to stop all what may prevent me from becoming disposed + //aGuard.reset(); + + m_bSuspended = bSuspend; + return sal_True; + } + else + { + //aGuard.clear(); + //@todo ??? redo what was made in section bSuspend==true + //aGuard.reset(); + + m_bSuspended = bSuspend; + return sal_True; + } + + + /* + if ( bSuspend ) + getFrame()->removeFrameActionListener( pImp ); + else + getFrame()->addFrameActionListener( pImp ); + */ + return sal_True; +} + +//----------------------------------------------------------------- +// XComponent (base of XController) +//----------------------------------------------------------------- + + void SAL_CALL ChartController +::dispose() throw(uno::RuntimeException) +{ + //This object should release all resources and references in the + //easiest possible manner + //This object must notify all registered listeners using the method + //<member>XEventListener::disposing</member> + + //hold no mutex + if( !m_aLifeTimeManager.dispose() ) + return; + + OSL_ENSURE( m_bSuspended, "dispose was called but controller is not suspended" ); + + //--release all resources and references + + impl_deleteView(); + m_pChartWindow = NULL;//m_pChartWindow is deleted via UNO by Window hierarchy or Framework + + m_xFrame = NULL; + TheModelRef aModelRef( m_aModel, m_aModelMutex); + m_aModel = NULL; + + if(aModelRef.is()) + { + aModelRef->removeListener( this ); + aModelRef->tryTermination(); + } + + //// @todo integrate specialized implementation + //e.g. release further resources and references + } + + void SAL_CALL ChartController +::addEventListener( const uno::Reference<lang::XEventListener>& xListener ) + throw(uno::RuntimeException) +{ + osl::Guard< osl::Mutex > aGuard( m_aControllerMutex ); + if( impl_isDisposedOrSuspended() )//@todo? allow adding of listeners in suspend mode? + return; //behave passive if already disposed or suspended + + //--add listener + m_aLifeTimeManager.m_aListenerContainer.addInterface( ::getCppuType((const uno::Reference< lang::XEventListener >*)0), xListener ); +} + + void SAL_CALL ChartController +::removeEventListener( const uno::Reference< + lang::XEventListener>& xListener ) + throw(uno::RuntimeException) +{ + osl::Guard< osl::Mutex > aGuard( m_aControllerMutex ); + if( impl_isDisposedOrSuspended() ) //@todo? allow removing of listeners in suspend mode? + return; //behave passive if already disposed or suspended + + //--remove listener + m_aLifeTimeManager.m_aListenerContainer.removeInterface( ::getCppuType((const uno::Reference< lang::XEventListener >*)0), xListener ); +} + + +//----------------------------------------------------------------- +// util::XCloseListener +//----------------------------------------------------------------- + void SAL_CALL ChartController +::queryClosing( const lang::EventObject& rSource, sal_Bool bGetsOwnership ) + throw(util::CloseVetoException, uno::RuntimeException) +{ + //do not use the m_aControllerMutex here because this call is not allowed to block + + TheModelRef aModelRef( m_aModel, m_aModelMutex); + + if( !aModelRef.is() ) + return; + + if( !(aModelRef->getModel() == rSource.Source) ) + { + OSL_ENSURE( sal_False, "queryClosing was called on a controller from an unknown source" ); + return; + } + + if( !m_bCanClose )//@todo tryaqcuire mutex + { + if( bGetsOwnership ) + { + aModelRef->SetOwnerShip( bGetsOwnership ); + } + + throw util::CloseVetoException(); + } + else + { + //@ todo prepare to to closing model -> don't start any further hindering actions + } +} + + void SAL_CALL ChartController +::notifyClosing( const lang::EventObject& rSource ) + throw(uno::RuntimeException) +{ + //Listener should deregister himself and relaese all references to the closing object. + + TheModelRef aModelRef( 0, m_aModelMutex); + bool bReleaseModel = sal_False; + { + ::osl::Guard< ::osl::Mutex > aGuard( m_aModelMutex ); + aModelRef = m_aModel; + if( aModelRef.is() && aModelRef->getModel() == rSource.Source ) + { + m_aModel = NULL; + bReleaseModel = sal_True; + } + } + //@todo ?? why remove the listener??? this could be handled by the closing object + if( bReleaseModel ) + { + //--stop listening to the closing model + aModelRef->removeListener( this ); + } +} + +//----------------------------------------------------------------- +// util::XEventListener (base of XCloseListener) +//----------------------------------------------------------------- + void SAL_CALL ChartController +::disposing( const lang::EventObject& rSource ) + throw(uno::RuntimeException) +{ + notifyClosing(rSource); +} + +//----------------------------------------------------------------- +// XDispatchProvider (required interface) +//----------------------------------------------------------------- + +bool isFormatObjectSID( sal_Int32 nSlotID ) +{ + if((sal_Int32)SID_DIAGRAM_TITLE_MAIN == nSlotID + || (sal_Int32)SID_DIAGRAM_TITLE_SUB == nSlotID + || (sal_Int32)SID_DIAGRAM_TITLE_X == nSlotID + || (sal_Int32)SID_DIAGRAM_TITLE_Y == nSlotID + || (sal_Int32)SID_DIAGRAM_TITLE_Z == nSlotID + || (sal_Int32)SID_DIAGRAM_TITLE_ALL == nSlotID + || (sal_Int32)SID_LEGEND == nSlotID + || (sal_Int32)SID_DIAGRAM_AXIS_X == nSlotID + || (sal_Int32)SID_DIAGRAM_AXIS_Y == nSlotID + || (sal_Int32)SID_DIAGRAM_AXIS_Z == nSlotID + || (sal_Int32)SID_DIAGRAM_AXIS_A == nSlotID //secondary x axis + || (sal_Int32)SID_DIAGRAM_AXIS_B == nSlotID + || (sal_Int32)SID_DIAGRAM_AXIS_ALL == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_X_MAIN == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_Y_MAIN == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_Z_MAIN == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_X_HELP == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_Y_HELP == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_Z_HELP == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_ALL == nSlotID + || (sal_Int32)SID_DIAGRAM_WALL == nSlotID + || (sal_Int32)SID_DIAGRAM_FLOOR == nSlotID + || (sal_Int32)SID_DIAGRAM_AREA == nSlotID + ) + return true; + return false; +} + + uno::Reference<frame::XDispatch> SAL_CALL ChartController +::queryDispatch( const util::URL& rURL + , const rtl::OUString& rTargetFrameName + , sal_Int32 nSearchFlags) + throw(uno::RuntimeException) +{ + //// @todo integrate specialized implementation + //decide which commands you can handle + + if ( !m_aLifeTimeManager.impl_isDisposed() ) + { + //@todo avoid OString (see Mathias mail on bug #104387#) + rtl::OString aCommand( rtl::OUStringToOString( rURL.Path, RTL_TEXTENCODING_ASCII_US ) ); + if( aCommand.equals("Save") + || aCommand.equals("SaveAs") + || aCommand.equals("SaveAll") + + || aCommand.equals("Undo") + || aCommand.equals("Cut") + || aCommand.equals("Copy") + || aCommand.equals("Paste") + || aCommand.equals("SelectAll") + || aCommand.equals("Close") + || aCommand.equals("TESTTEST") + || aCommand.equals("slot:23") + //|| aCommand.copy(0,4).EqualsAscii("Bib/") + //|| aURL.Complete.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("slot:5503")) + ) + { + //@todo create a seperate dispatcher object or implement XDispatch interface by yourself + //to return it here + return static_cast< frame::XDispatch* >( this ); + } + else if(rURL.Protocol.equalsIgnoreAsciiCase( C2U("slot:") ) ) + { + sal_Int32 nSlotID = rURL.Path.toInt32(); + if( (sal_Int32)SID_DIAGRAM_OBJECTS == nSlotID + || (sal_Int32)SID_DIAGRAM_TYPE == nSlotID + || (sal_Int32)SID_INSERT_TITLE == nSlotID + || (sal_Int32)SID_INSERT_CHART_LEGEND == nSlotID + || (sal_Int32)SID_INSERT_DESCRIPTION == nSlotID + || (sal_Int32)SID_INSERT_AXIS == nSlotID + || (sal_Int32)SID_INSERT_GRIDS == nSlotID + || (sal_Int32)SID_INSERT_STATISTICS == nSlotID + || (sal_Int32)SID_CHARMAP == nSlotID + || isFormatObjectSID(nSlotID) + ) + { + return static_cast< frame::XDispatch* >( this ); + } + } + } + return uno::Reference< frame::XDispatch > (); +} +/* +typedef ::std::map< sal_Int32, ::rtl::OUString > tSlotIdCommandMap; +typedef ::comphelper::MakeMap< sal_Int32, ::rtl::OUString > tMakeSlotIdCommandMap; +tMakeSlotIdCommandMap m_aSlotIdCommandMap = + tMakeSlotIdCommandMap + ( (sal_Int32)SID_DIAGRAM_TITLE_MAIN, C2U( "slot:" )+=rtl::OUString::valueOf( (sal_Int32)SID_DIAGRAM_TITLE_MAIN ) ) + ; +*/ + uno::Sequence<uno::Reference<frame::XDispatch > > ChartController +::queryDispatches( const uno::Sequence< + frame::DispatchDescriptor>& xDescripts) + throw(uno::RuntimeException) +{ + sal_Int32 nCount = xDescripts.getLength(); + + if( !nCount ) + return uno::Sequence<uno::Reference<frame::XDispatch > > (); + + uno::Sequence<uno::Reference<frame::XDispatch > > aRet( nCount ); + for( sal_Int32 nPos = 0; nPos<nCount; ++nPos ) + { + aRet[ nPos ] = queryDispatch( + xDescripts[nPos].FeatureURL + , xDescripts[nPos].FrameName + , xDescripts[nPos].SearchFlags ); + } + return aRet; +} + +//----------------------------------------------------------------- +// frame::XDispatch +//----------------------------------------------------------------- + + void SAL_CALL ChartController +::dispatch( const util::URL& rURL + , const uno::Sequence< beans::PropertyValue >& rArgs ) + throw (uno::RuntimeException) +{ + //@todo avoid OString (see Mathias mail on bug #104387#) + rtl::OString aCommand( rtl::OUStringToOString( rURL.Path, RTL_TEXTENCODING_ASCII_US ) ); + //test only + if(aCommand.equals("TESTTEST") + || aCommand.equals("Undo") ) + { + Window* pWindow = m_pChartWindow; + Rectangle aRect( Point(0,0), pWindow->GetOutputSize() ); + Region aRegion( aRect ); + m_pDrawViewWrapper->InitRedraw(pWindow, aRegion ); + + /* + INVALIDATE_CHILDREN + INVALIDATE_NOCHILDREN + INVALIDATE_NOERASE + INVALIDATE_UPDATE + INVALIDATE_TRANSPARENT + INVALIDATE_NOTRANSPARENT + INVALIDATE_NOCLIPCHILDREN + */ + //Invalidate(INVALIDATE_UPDATE); + } + + else if(aCommand.equals("Save")) + { + //only test: + impl_rebuildView(); + } + else if(aCommand.equals("SaveAs")) + { + //only test: + this->executeDispatch_ObjectToDefault(); + } + //---------------------------------- + else if(rURL.Protocol.equalsIgnoreAsciiCase( C2U("slot:") ) ) + { + sal_Int32 nSlotID = rURL.Path.toInt32(); + if((sal_Int32)SID_DIAGRAM_OBJECTS == nSlotID) + { + this->executeDispatch_ObjectProperties(); + } + else if((sal_Int32)SID_DIAGRAM_TYPE == nSlotID) + { + this->executeDispatch_ChartType(); + } + else if((sal_Int32)SID_INSERT_TITLE == nSlotID) + { + this->executeDispatch_InsertTitle(); + } + else if((sal_Int32)SID_INSERT_CHART_LEGEND == nSlotID) + { + this->executeDispatch_InsertLegend(); + } + else if((sal_Int32)SID_INSERT_DESCRIPTION == nSlotID) + { + this->executeDispatch_InsertDataLabel(); + } + else if((sal_Int32)SID_INSERT_AXIS == nSlotID) + { + this->executeDispatch_InsertAxis(); + } + else if((sal_Int32)SID_INSERT_GRIDS == nSlotID) + { + this->executeDispatch_InsertGrid(); + } + else if((sal_Int32)SID_INSERT_STATISTICS == nSlotID) + { + this->executeDispatch_InsertStatistic(); + } + else if((sal_Int32)SID_CHARMAP == nSlotID) + { + this->executeDispatch_InsertSpecialCharacter(); + } + else if( isFormatObjectSID(nSlotID) ) + { + this->executeDispatch_FormatObject(nSlotID); + } + } + else if(aCommand.equals("SaveAll")) + { + if( m_aModel.is()) + { + uno::Reference< ::drafts::com::sun::star::chart2::XChartDocument > xDoc( + m_aModel->getModel(), uno::UNO_QUERY ); + OSL_ASSERT( xDoc.is()); + + uno::Reference< ::drafts::com::sun::star::chart2::XDataProvider > xDataProvider( + m_xCC->getServiceManager()->createInstanceWithContext( + C2U( "com.sun.star.comp.chart.FileDataProvider" ), + m_xCC ), uno::UNO_QUERY ); + OSL_ASSERT( xDataProvider.is()); + + ::rtl::OUString aFileName( +#if defined WNT + RTL_CONSTASCII_USTRINGPARAM( "file:///D:/files/data.chd" ) +#else + RTL_CONSTASCII_USTRINGPARAM( "file:///work/data/data.chd" ) +#endif + ); + + xDoc->attachDataProvider( xDataProvider ); + xDoc->setRangeRepresentation( aFileName ); + impl_rebuildView(); + } + } +} + + void SAL_CALL ChartController +::addStatusListener( const uno::Reference<frame::XStatusListener >& xControl + , const util::URL& aURL ) + throw (uno::RuntimeException) +{ +} + + void SAL_CALL ChartController +::removeStatusListener( const uno::Reference<frame::XStatusListener >& xControl + , const util::URL& aURL ) + throw (uno::RuntimeException) +{ +} + +//----------------------------------------------------------------- +// XContextMenuInterception (optional interface) +//----------------------------------------------------------------- + void SAL_CALL ChartController +::registerContextMenuInterceptor( const uno::Reference< + ui::XContextMenuInterceptor > & xInterceptor) + throw(uno::RuntimeException) +{ + //@todo +} + + void SAL_CALL ChartController +::releaseContextMenuInterceptor( const uno::Reference< + ui::XContextMenuInterceptor > & xInterceptor) + throw(uno::RuntimeException) +{ + //@todo +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +void SAL_CALL ChartController::executeDispatch_ChartType() +{ + bool bChanged = false; + + //------------------------------------------------------------- + //convert properties to ItemSet + uno::Reference< beans::XPropertySet > xProp; + uno::Reference< XChartDocument > xChartDoc( m_aModel->getModel(), uno::UNO_QUERY ); + if( xChartDoc.is()) + xProp.set( xChartDoc->getChartTypeManager(), uno::UNO_QUERY ); + DBG_ASSERT( xProp.is(), "Invalid ChartTypeManager" ); + + { + wrapper::ChartTypeItemConverter aItemConverter( xProp, m_pDrawModelWrapper->GetItemPool() ); + SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();//creates only an empty itemset + aItemConverter.FillItemSet( aItemSet ); + //------------------------------------------------------------- + //prepare and open dialog + Window* pParent( NULL ); + SchDiagramTypeDlg aDlg( pParent, aItemSet ); + if( aDlg.Execute() == RET_OK ) + { + SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet(); + aDlg.GetAttr( aOutItemSet ); + + bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now + } + } + + try + { + //make sure that all objects using m_pDrawModelWrapper or m_pChartView are already deleted + if(bChanged && + xChartDoc.is()) + { + uno::Reference< lang::XMultiServiceFactory > xFact( xProp, uno::UNO_QUERY ); + if( xFact.is() ) + { + ::rtl::OUString aServiceName; + if( xProp->getPropertyValue( C2U( "ChartStyleTemplateServiceName" )) >>= aServiceName ) + { + uno::Reference< XChartTypeTemplate > xTemplate( + xFact->createInstance( aServiceName ), uno::UNO_QUERY ); + xChartDoc->setChartTypeTemplate( xTemplate ); + if( xTemplate.is()) + xTemplate->changeDiagram( xChartDoc->getDiagram() ); + impl_rebuildView(); + } + } + } + } + catch( uno::RuntimeException& e) + { + e; + } +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/main/ChartController.hxx new file mode 100644 index 000000000000..ef74026bb600 --- /dev/null +++ b/chart2/source/controller/main/ChartController.hxx @@ -0,0 +1,526 @@ +/************************************************************************* + * + * $RCSfile: ChartController.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART_CONTROLLER_HXX +#define _CHART_CONTROLLER_HXX + +#include "LifeTime.hxx" +#include "ServiceMacros.hxx" + +#ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_ +#include <com/sun/star/frame/XController.hpp> +#endif +#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_ +#include <com/sun/star/frame/XDispatchProvider.hpp> +#endif +#ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_ +#include <com/sun/star/frame/XDispatch.hpp> +#endif +#ifndef _COM_SUN_STAR_VIEW_XSELECTIONSUPPLIER_HPP_ +#include <com/sun/star/view/XSelectionSupplier.hpp> +#endif +#ifndef _COM_SUN_STAR_UI_XCONTEXTMENUINTERCEPTION_HPP_ +#include <com/sun/star/ui/XContextMenuInterception.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XWEAK_HPP_ +#include <com/sun/star/uno/XWeak.hpp> +#endif +#ifndef _COM_SUN_STAR_SDBC_XCLOSELISTENER_HPP_ +#include <com/sun/star/util/XCloseListener.hpp> +#endif +#ifndef _COM_SUN_STAR_SDBC_XCLOSEABLE_HPP_ +#include <com/sun/star/util/XCloseable.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif +#ifndef _CPPUHELPER_IMPLBASE6_HXX_ +#include <cppuhelper/implbase8.hxx> +#endif + +// header for class MouseEvent +#ifndef _SV_EVENT_HXX +#include <vcl/event.hxx> +#endif + +//============================================================================= +/** this is an example implementation for the service ::com::sun::star::frame::Controller +*/ + +//............................................................................. +namespace chart +{ +//............................................................................. + +class WindowController +{ +public: + virtual void execute_Paint( const Rectangle& rRect )=0; + virtual void execute_MouseButtonDown( const MouseEvent& rMEvt )=0; + virtual void execute_MouseMove( const MouseEvent& rMEvt )=0; + virtual void execute_Tracking( const TrackingEvent& rTEvt )=0; + virtual void execute_MouseButtonUp( const MouseEvent& rMEvt )=0; + virtual void execute_Resize()=0; + virtual void execute_Activate()=0; + virtual void execute_Deactivate()=0; + virtual void execute_GetFocus()=0; + virtual void execute_LoseFocus()=0; + virtual void execute_Command( const CommandEvent& rCEvt )=0; +}; + +class ChartWindow; +class ChartView; +class DrawModelWrapper; +class DrawViewWrapper; +class NumberFormatterWrapper; +class ChartController : public ::cppu::WeakImplHelper8 < + ::com::sun::star::frame::XController //comprehends XComponent (required interface) + ,::com::sun::star::frame::XDispatchProvider //(required interface) + ,::com::sun::star::view::XSelectionSupplier //(optional interface) + ,::com::sun::star::ui::XContextMenuInterception //(optional interface) + ,::com::sun::star::util::XCloseListener //(needed for communication with XModel) + ,::com::sun::star::lang::XServiceInfo + // ,public ::com::sun::star::uno::XWeak // implemented by WeakImplHelper(optional interface) + // ,public ::com::sun::star::uno::XInterface // implemented by WeakImplHelper(optional interface) + // ,public ::com::sun::star::lang::XTypeProvider // implemented by WeakImplHelper + ,::com::sun::star::frame::XDispatch + ,::com::sun::star::awt::XWindow //this is the Window Controller part of this Controller, that will be given to a Frame via setComponent + > + , public WindowController +{ + +private: + class TheModelRef; + friend class ChartController::TheModelRef; + class RefCountable + { + public: + RefCountable(); + virtual ~RefCountable(); + void acquire(); + void release(); + private: + sal_Int32 volatile m_nRefCount; + }; + class TheModel : public RefCountable + { + public: + TheModel( const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > & xModel ); + + virtual ~TheModel(); + + void SetOwnerShip( sal_Bool bGetsOwnership ); + void addListener( ChartController* pController ); + void removeListener( ChartController* pController ); + void tryTermination(); + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > + getModel() { return m_xModel;} + + private: + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xModel; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > m_xCloseable; + + //the ownership between model and controller is not clear at first + //each controller might consider himself as owner of the model first + sal_Bool volatile m_bOwnership; + //with a XCloseable::close call and during XCloseListener::queryClosing + //the ownership can be regulated more explicit, + //if so the ownership is considered to be well known + sal_Bool volatile m_bOwnershipIsWellKnown; + }; + class TheModelRef + { + public: + TheModelRef( TheModel* pTheModel, ::osl::Mutex& rMutex ); + TheModelRef( const TheModelRef& rTheModel, ::osl::Mutex& rMutex ); + TheModelRef& operator=(ChartController::TheModel* pTheModel); + TheModelRef& operator=(const TheModelRef& rTheModel); + virtual ~TheModelRef(); + sal_Bool is() const; + TheModel* operator->() const { return m_pTheModel; } + private: + TheModel* m_pTheModel; + mutable ::osl::Mutex& m_rModelMutex; + }; + +private: + mutable ::apphelper::LifeTimeManager m_aLifeTimeManager; + + mutable ::osl::Mutex m_aControllerMutex; + sal_Bool volatile m_bSuspended; + sal_Bool volatile m_bCanClose; + + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xCC; + + //model + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame; + mutable ::osl::Mutex m_aModelMutex; + TheModelRef m_aModel; + + //view + ChartWindow* m_pChartWindow; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xViewWindow; + ChartView* m_pChartView; + DrawModelWrapper* m_pDrawModelWrapper; + DrawViewWrapper* m_pDrawViewWrapper; + + ::rtl::OUString m_aSelectedObjectCID;//only single object selection so far + + bool m_bViewDirty; //states wether the view needs to be rebuild + + NumberFormatterWrapper* m_pNumberFormatterWrapper; + +private: + //private methods + + sal_Bool impl_isDisposedOrSuspended(); + + sal_Bool SAL_CALL impl_tryInitializeView() throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL impl_deleteView() throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL impl_rebuildView() throw(::com::sun::star::uno::RuntimeException); + + //executeDispatch methods + void SAL_CALL executeDispatch_ObjectProperties(); + void SAL_CALL executeDispatch_FormatObject(sal_Int32 nSlotId); + void SAL_CALL executeDlg_ObjectProperties( const ::rtl::OUString& rObjectCID ); + + void SAL_CALL executeDispatch_ChartType(); + void SAL_CALL executeDispatch_ObjectToDefault(); + + void SAL_CALL executeDispatch_InsertTitle(); + void SAL_CALL executeDispatch_InsertLegend(); + void SAL_CALL executeDispatch_InsertDataLabel(); + void SAL_CALL executeDispatch_InsertAxis(); + void SAL_CALL executeDispatch_InsertGrid(); + void SAL_CALL executeDispatch_InsertStatistic(); + void SAL_CALL executeDispatch_InsertSpecialCharacter(); + + // + void execute_DoubleClick(); + + +public: + //no default constructor + ChartController(::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext); + virtual ~ChartController(); + + //----------------------------------------------------------------- + // ::com::sun::star::lang::XServiceInfo + //----------------------------------------------------------------- + + APPHELPER_XSERVICEINFO_DECL() + APPHELPER_SERVICE_FACTORY_HELPER(ChartController) + + //----------------------------------------------------------------- + // ::com::sun::star::frame::XController (required interface) + //----------------------------------------------------------------- + virtual void SAL_CALL + attachFrame( const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XFrame > & xFrame ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL + attachModel( const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > & xModel ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL + getFrame() throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL + getModel() throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Any SAL_CALL + getViewData() throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + restoreViewData( const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL + suspend( sal_Bool bSuspend ) + throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::lang::XComponent (base of XController) + //----------------------------------------------------------------- + virtual void SAL_CALL + dispose() throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + addEventListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + removeEventListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener ) + throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::frame::XDispatchProvider (required interface) + //----------------------------------------------------------------- + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XDispatch> SAL_CALL + queryDispatch( const ::com::sun::star::util::URL& rURL + , const rtl::OUString& rTargetFrameName + , sal_Int32 nSearchFlags) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XDispatch > > SAL_CALL + queryDispatches( const ::com::sun::star::uno::Sequence< + ::com::sun::star::frame::DispatchDescriptor > & xDescripts) + throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::view::XSelectionSupplier (optional interface) + //----------------------------------------------------------------- + virtual sal_Bool SAL_CALL + select( const ::com::sun::star::uno::Any& rSelection ) + throw ( com::sun::star::lang::IllegalArgumentException ); + + virtual ::com::sun::star::uno::Any SAL_CALL + getSelection() throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + addSelectionChangeListener( const ::com::sun::star::uno::Reference< + com::sun::star::view::XSelectionChangeListener > & xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + removeSelectionChangeListener( const ::com::sun::star::uno::Reference< + com::sun::star::view::XSelectionChangeListener > & xListener ) + throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::ui::XContextMenuInterception (optional interface) + //----------------------------------------------------------------- + virtual void SAL_CALL + registerContextMenuInterceptor( const ::com::sun::star::uno::Reference< + ::com::sun::star::ui::XContextMenuInterceptor > & xInterceptor) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + releaseContextMenuInterceptor( const ::com::sun::star::uno::Reference< + ::com::sun::star::ui::XContextMenuInterceptor > & xInterceptor) + throw (::com::sun::star::uno::RuntimeException); + + + //----------------------------------------------------------------- + //----------------------------------------------------------------- + //additional interfaces + + //----------------------------------------------------------------- + // ::com::sun::star::util::XCloseListener + //----------------------------------------------------------------- + virtual void SAL_CALL + queryClosing( const ::com::sun::star::lang::EventObject& Source + , sal_Bool GetsOwnership ) + throw (::com::sun::star::util::CloseVetoException + , ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + notifyClosing( const ::com::sun::star::lang::EventObject& Source ) + throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::util::XEventListener (base of XCloseListener) + //----------------------------------------------------------------- + virtual void SAL_CALL + disposing( const ::com::sun::star::lang::EventObject& Source ) + throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::frame::XDispatch + //----------------------------------------------------------------- + + virtual void SAL_CALL + dispatch( const ::com::sun::star::util::URL& aURL + , const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& aArgs ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + addStatusListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XStatusListener >& xControl + , const ::com::sun::star::util::URL& aURL ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + removeStatusListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XStatusListener >& xControl + , const ::com::sun::star::util::URL& aURL ) + throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::awt::XWindow + //----------------------------------------------------------------- + virtual void SAL_CALL + setPosSize( sal_Int32 X, sal_Int32 Y + , sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::awt::Rectangle SAL_CALL + getPosSize() + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + setVisible( sal_Bool Visible ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + setEnable( sal_Bool Enable ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + setFocus() throw (::com::sun::star::uno::RuntimeException); + + //---------------- + virtual void SAL_CALL + addWindowListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XWindowListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + removeWindowListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XWindowListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + addFocusListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XFocusListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + removeFocusListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XFocusListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + addKeyListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XKeyListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + removeKeyListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XKeyListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + addMouseListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XMouseListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + removeMouseListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XMouseListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + addMouseMotionListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XMouseMotionListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + removeMouseMotionListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XMouseMotionListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + addPaintListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XPaintListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + removePaintListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XPaintListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // chart2::WindowController + //----------------------------------------------------------------- + virtual void execute_Paint( const Rectangle& rRect ); + virtual void execute_MouseButtonDown( const MouseEvent& rMEvt ); + virtual void execute_MouseMove( const MouseEvent& rMEvt ); + virtual void execute_Tracking( const TrackingEvent& rTEvt ); + virtual void execute_MouseButtonUp( const MouseEvent& rMEvt ); + virtual void execute_Resize(); + virtual void execute_Activate(); + virtual void execute_Deactivate(); + virtual void execute_GetFocus(); + virtual void execute_LoseFocus(); + virtual void execute_Command( const CommandEvent& rCEvt ); + //----------------------------------------------------------------- +}; + +//............................................................................. +} // namespace chart +//............................................................................. + +#endif + diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx new file mode 100644 index 000000000000..2c6e848037ff --- /dev/null +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -0,0 +1,588 @@ +/************************************************************************* + * + * $RCSfile: ChartController_Insert.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ChartController.hxx" + +#include "dlg_InsertAxis_Grid.hxx" +#include "dlg_InsertDataLabel.hxx" +#include "dlg_InsertLegend.hxx" +#include "dlg_InsertStatistic.hxx" +#include "dlg_InsertTitle.hxx" + +#include "ChartModelHelper.hxx" +#include "MeterHelper.hxx" +#include "TitleHelper.hxx" +#include "ContextHelper.hxx" +#include "macros.hxx" +#include "DrawModelWrapper.hxx" +#include "MultipleItemConverter.hxx" + +//maybe superfluous in future: +#include "ChartTypeItemConverter.hxx" + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XAXISCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XAxisContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XBOUNDEDCOORDINATESYSTEMCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XBoundedCoordinateSystemContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDIAGRAM_HPP_ +#include <drafts/com/sun/star/chart2/XDiagram.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XGRIDCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XGridContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTITLED_HPP_ +#include <drafts/com/sun/star/chart2/XTitled.hpp> +#endif + +//-------------------------------------- + +// header for define RET_OK +#ifndef _SV_MSGBOX_HXX +#include <vcl/msgbox.hxx> +#endif +// header for class OUStringBuffer +#ifndef _RTL_USTRBUF_HXX_ +#include <rtl/ustrbuf.hxx> +#endif +// header for class SvxCharacterMap +#ifndef _SVX_CHARMAP_HXX +#include <svx/charmap.hxx> +#endif + +#ifndef _COM_SUN_STAR_UTIL_XCLONEABLE_HPP_ +#include <com/sun/star/util/XCloneable.hpp> +#endif + + +//............................................................................. +namespace chart +{ +//............................................................................. + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +namespace +{ +//----------------------------------------------------------------------------- +//status of grid or axis + +void getExistingAxes( uno::Sequence< sal_Bool >& rExistenceList, const uno::Reference< XDiagram >& xDiagram ) +{ + rExistenceList.realloc(6); + + sal_Int32 nN; + uno::Reference< XAxis > xAxis; + for(nN=0;nN<3;nN++) + { + xAxis = MeterHelper::getAxis( nN, true, xDiagram ); + rExistenceList[nN] = xAxis.is(); + } + for(nN=3;nN<6;nN++) + { + xAxis = MeterHelper::getAxis( nN%3, false, xDiagram ); + rExistenceList[nN] = xAxis.is(); + } +} + +void getExistingGrids( uno::Sequence< sal_Bool >& rExistenceList, const uno::Reference< XDiagram >& xDiagram ) +{ + sal_Int32 nN; + uno::Reference< XGrid > xGrid; + for(nN=0;nN<3;nN++) + { + xGrid = MeterHelper::getGrid( nN, true, xDiagram ); + rExistenceList[nN] = xGrid.is(); + } + for(nN=3;nN<6;nN++) + { + xGrid = MeterHelper::getGrid( nN%3, false, xDiagram ); + rExistenceList[nN] = xGrid.is(); + } +} + +//----------------------------------------------------------------------------- +//change grid or axis + +void createAxis( sal_Int32 nDimensionIndex, bool bMainAxis + , const uno::Reference< XDiagram >& xDiagram + , const uno::Reference< uno::XComponentContext >& xContext ) +{ + sal_Int32 nCooSysIndex = bMainAxis ? 0 : 1; + uno::Reference< XBoundedCoordinateSystem > xCooSys = MeterHelper::getBoundedCoordinateSystemByIndex( xDiagram, nCooSysIndex ); + if(!xCooSys.is()) + { + //create a new CooSys by cloning it from another exsisting one + uno::Reference< XBoundedCoordinateSystem > xOtherCooSys + = MeterHelper::getBoundedCoordinateSystemByIndex( xDiagram, nCooSysIndex-1 ); + if(!xOtherCooSys.is()) //@todo? ... + return; + + uno::Reference< util::XCloneable > xCloneable( xOtherCooSys,uno::UNO_QUERY); + if( xCloneable.is() ) + xCooSys = uno::Reference< XBoundedCoordinateSystem >( xCloneable->createClone(), uno::UNO_QUERY ); + + uno::Reference< XBoundedCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY ); + if( xCooSysCnt.is() && xCooSys.is() ) + xCooSysCnt->addCoordinateSystem( xCooSys ); + } + // create axis + MeterHelper::createAxis( nDimensionIndex, xCooSys, uno::Reference< XAxisContainer >( xDiagram, uno::UNO_QUERY ), xContext ); +} + +void createGrid( sal_Int32 nDimensionIndex, sal_Int32 nCooSysIndex, bool bMainGrid + , const uno::Reference< XDiagram >& xDiagram + , const uno::Reference< uno::XComponentContext >& xContext ) +{ + uno::Reference< XBoundedCoordinateSystem > xCooSys = MeterHelper::getBoundedCoordinateSystemByIndex( xDiagram, nCooSysIndex ); + if(!xCooSys.is()) + { + //@todo create initial coosys if none exsists (but this state is not likly to occur) + return; + } + // create grid + uno::Reference< XGrid > xGrid; + OSL_ENSURE( nDimensionIndex <= 3, "Check Code for more than 3 dimensions" ); + + ::rtl::OUStringBuffer aId( MeterHelper::makeGridIdentifier( nDimensionIndex, nCooSysIndex, bMainGrid ) ); + + ContextHelper::tContextEntryMapType aContextValues( + ContextHelper::MakeContextEntryMap( + C2U( "Identifier" ), uno::makeAny( aId.makeStringAndClear()) )); + + xGrid.set( xContext->getServiceManager()->createInstanceWithContext( + C2U( "drafts.com.sun.star.chart2.Grid" ), + ContextHelper::createContext( aContextValues, xContext ) ) + , uno::UNO_QUERY ); + OSL_ASSERT( xGrid.is()); + if( xGrid.is()) + { + xGrid->attachCoordinateSystem( xCooSys, nDimensionIndex ); + uno::Reference< XGridContainer > xGridContainer( xDiagram, uno::UNO_QUERY ); + xGridContainer->addGrid( xGrid ); + } +} + +bool changeExistingAxes( const uno::Reference< XDiagram >& xDiagram + , const uno::Sequence< sal_Bool >& rOldExistenceList + , const uno::Sequence< sal_Bool >& rNewExistenceList + , const uno::Reference< uno::XComponentContext >& xContext ) +{ + bool bChanged = false; + for(sal_Int32 nN=0;nN<6;nN++) + { + if(rOldExistenceList[nN]!=rNewExistenceList[nN]) + { + bChanged = true; + if(rNewExistenceList[nN]) //add axis + { + createAxis( nN%3, nN<3, xDiagram, xContext ); + } + else //remove axis + { + uno::Reference< XAxisContainer > xAxisContainer( xDiagram, uno::UNO_QUERY ); + if(xAxisContainer.is()) + { + uno::Reference< XAxis > xAxis = MeterHelper::getAxis( nN%3, nN<3, xDiagram ); + xAxisContainer->removeAxis(xAxis); + } + } + } + } + return bChanged; +} + +bool changeExistingGrids( const uno::Reference< XDiagram >& xDiagram + , const uno::Sequence< sal_Bool >& rOldExistenceList + , const uno::Sequence< sal_Bool >& rNewExistenceList + , const uno::Reference< uno::XComponentContext >& xContext ) +{ + bool bChanged = false; + for(sal_Int32 nN=0;nN<6;nN++) + { + if(rOldExistenceList[nN]!=rNewExistenceList[nN]) + { + bChanged = true; + if(rNewExistenceList[nN]) //add grid + { + createGrid( nN%3, 0, nN<3, xDiagram, xContext ); + } + else //remove grid + { + uno::Reference< XGridContainer > xGridContainer( xDiagram, uno::UNO_QUERY ); + if(xGridContainer.is()) + { + uno::Reference< XGrid > xGrid = MeterHelper::getGrid( nN%3, nN<3, xDiagram ); + xGridContainer->removeGrid(xGrid); + } + } + } + } + return bChanged; +} + +//----------------------------------------------------------------------------- +//status of titles +void fillInsertTitleDialogDataFromModel( InsertTitleDialogData& rDialogData + , const uno::Reference< frame::XModel>& xChartModel ) +{ + uno::Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram(xChartModel); + + //get possibilities + uno::Sequence< sal_Bool > aMeterPossibilityList; + MeterHelper::getMeterPossibilities( aMeterPossibilityList, xDiagram ); + rDialogData.aPossibilityList[2]=aMeterPossibilityList[0];//x axis title + rDialogData.aPossibilityList[3]=aMeterPossibilityList[1];//y axis title + rDialogData.aPossibilityList[4]=aMeterPossibilityList[2];//z axis title + + //find out which title exsist and get their text + //main title: + for( sal_Int32 nTitleIndex = 0; nTitleIndex<5; nTitleIndex++) + { + uno::Reference< XTitle > xTitle = TitleHelper::getTitle( + static_cast< TitleHelper::eTitleType >( nTitleIndex ), xChartModel ); + rDialogData.aExistenceList[nTitleIndex] = xTitle.is(); + rDialogData.aTextList[nTitleIndex]=TitleHelper::getCompleteString( xTitle ); + } +} + +//----------------------------------------------------------------------------- +//change existing titles + +bool changeExistingTitles( const uno::Reference< frame::XModel >& xModel + , const InsertTitleDialogData& rOldState + , const InsertTitleDialogData& rNewState + , const uno::Reference< uno::XComponentContext >& xContext ) +{ + bool bChanged = false; + for(sal_Int32 nN=0;nN<5;nN++) + { + if( rOldState.aExistenceList[nN] != rNewState.aExistenceList[nN] ) + { + if(rNewState.aExistenceList[nN]) + { + TitleHelper::createTitle( + static_cast< TitleHelper::eTitleType >( nN ), rNewState.aTextList[nN], xModel, xContext ); + bChanged = true; + } + else + { + TitleHelper::removeTitle( static_cast< TitleHelper::eTitleType >( nN ), xModel ); + bChanged = true; + } + } + else if( rOldState.aTextList[nN] != rNewState.aTextList[nN] ) + { + //change content + uno::Reference< XTitle > xTitle( + TitleHelper::getTitle( static_cast< TitleHelper::eTitleType >( nN ), xModel ) ); + if(xTitle.is()) + { + TitleHelper::setCompleteString( rNewState.aTextList[nN], xTitle, xContext ); + bChanged = true; + } + } + } + return bChanged; +} + +}// anonymous namespace + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +void SAL_CALL ChartController::executeDispatch_InsertAxis() +{ + try + { + Window* pParent( NULL ); + InsertMeterDialogData aDialogInput; + uno::Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram(m_aModel->getModel()); + getExistingAxes( aDialogInput.aExistenceList, xDiagram ); + MeterHelper::getMeterPossibilities( aDialogInput.aPossibilityList, xDiagram ); + + SchAxisDlg aDlg( pParent, aDialogInput ); + if( aDlg.Execute() == RET_OK ) + { + InsertMeterDialogData aDialogOutput; + aDlg.getResult( aDialogOutput ); + bool bChanged = changeExistingAxes( xDiagram + , aDialogInput.aExistenceList, aDialogOutput.aExistenceList, m_xCC ); + if(bChanged) + impl_rebuildView(); + } + } + catch( uno::RuntimeException& e) + { + e; + } +} + +void SAL_CALL ChartController::executeDispatch_InsertGrid() +{ + try + { + Window* pParent( NULL ); + InsertMeterDialogData aDialogInput; + uno::Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram(m_aModel->getModel()); + getExistingGrids( aDialogInput.aExistenceList, xDiagram ); + MeterHelper::getMeterPossibilities( aDialogInput.aPossibilityList, xDiagram, false ); + + SchGridDlg aDlg( pParent, aDialogInput );//aItemSet, b3D, bNet, bSecondaryX, bSecondaryY ); + if( aDlg.Execute() == RET_OK ) + { + InsertMeterDialogData aDialogOutput; + aDlg.getResult( aDialogOutput ); + bool bChanged = changeExistingGrids( xDiagram + , aDialogInput.aExistenceList, aDialogOutput.aExistenceList, m_xCC ); + if(bChanged) + impl_rebuildView(); + } + } + catch( uno::RuntimeException& e) + { + e; + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +void SAL_CALL ChartController::executeDispatch_InsertTitle() +{ + try + { + Window* pParent( NULL ); + InsertTitleDialogData aDialogInput; + fillInsertTitleDialogDataFromModel( aDialogInput, m_aModel->getModel() ); + + SchTitleDlg aDlg( pParent, aDialogInput ); + if( aDlg.Execute() == RET_OK ) + { + InsertTitleDialogData aDialogOutput; + aDlg.getResult( aDialogOutput ); + bool bChanged = changeExistingTitles( + m_aModel->getModel(), aDialogInput, aDialogOutput, m_xCC ); + if(bChanged) + impl_rebuildView(); + } + } + catch( uno::RuntimeException& e) + { + e; + } +} + +void SAL_CALL ChartController::executeDispatch_InsertLegend() +{ + try + { + bool bChanged = false; + + uno::Reference< beans::XPropertySet > xProp=NULL; + //@todo use correct ItemConverter if available + wrapper::ChartTypeItemConverter aItemConverter( xProp, m_pDrawModelWrapper->GetItemPool() ); + SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet(); + //aItemConverter.FillItemSet( aItemSet ); + + //prepare and open dialog + Window* pParent( NULL ); + SchLegendDlg aDlg( pParent, aItemSet); + if( aDlg.Execute() == RET_OK ) + { + SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet(); + aDlg.GetAttr( aOutItemSet ); + + bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now + } + } + catch( uno::RuntimeException& e) + { + e; + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +void SAL_CALL ChartController::executeDispatch_InsertDataLabel() +{ + bool bChanged = false; + try + { + wrapper::AllDataLabelItemConverter aItemConverter( + m_aModel->getModel(), + m_pDrawModelWrapper->GetItemPool(), + m_pDrawModelWrapper->getSdrModel()); + SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet(); + aItemConverter.FillItemSet( aItemSet ); + + //prepare and open dialog + Window* pParent( NULL ); + SchDataDescrDlg aDlg( pParent, aItemSet); + if( aDlg.Execute() == RET_OK ) + { + SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet(); + aDlg.GetAttr( aOutItemSet ); + bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now + } + } + catch( uno::RuntimeException& e) + { + e; + } + //make sure that all objects using m_pDrawModelWrapper or m_pChartView are already deleted + if(bChanged) try + { + impl_rebuildView(); + } + catch( uno::RuntimeException& e) + { + e; + } +} + +void SAL_CALL ChartController::executeDispatch_InsertStatistic() +{ + try + { + bool bChanged = false; + + uno::Reference< beans::XPropertySet > xProp=NULL; + //@todo use correct ItemConverter if available + wrapper::ChartTypeItemConverter aItemConverter( xProp, m_pDrawModelWrapper->GetItemPool() ); + SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet(); + //aItemConverter.FillItemSet( aItemSet ); + + //prepare and open dialog + Window* pParent( NULL ); + SchDataStatisticsDlg aDlg( pParent, aItemSet); + if( aDlg.Execute() == RET_OK ) + { + SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet(); + aDlg.GetAttr( aOutItemSet ); + + bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now + } + } + catch( uno::RuntimeException& e) + { + e; + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +void SAL_CALL ChartController::executeDispatch_InsertSpecialCharacter() +{ + SvxCharacterMap aDlg( NULL, FALSE ); + /* + OutlinerView* pOV = NULL; + SdrOutliner* pOL = NULL; + + // set the current font + pOV = pView->GetTextEditOutlinerView(); + if( !pOV ) + return; + pOL = pView->GetTextEditOutliner(); + OutputDevice *pOut = pOL->GetRefDevice(); + aDlg.SetFont( pOut->GetFont() ); + + // the font mustn't be changed + aDlg.DisableFontSelection(); + */ + if( aDlg.Execute() == RET_OK ) + { + String aString( aDlg.GetCharacters() ); + /* + // insert string + + // prevent flicker + pOV->HideCursor(); + pOL->SetUpdateMode(FALSE); + + // delete current selection by inserting empty String, so current + // attributes become unique (sel. has to be erased anyway) + pOV->InsertText(String()); + + SfxUndoManager& rUndoMgr = pOL->GetUndoManager(); + rUndoMgr.EnterListAction( String( SchResId( STR_UNDO_INSERT_SPECCHAR )), String( SchResId( STR_UNDO_INSERT_SPECCHAR ))); + pOV->InsertText(aString, TRUE); + + ESelection aSel = pOV->GetSelection(); + aSel.nStartPara = aSel.nEndPara; + aSel.nStartPos = aSel.nEndPos; + pOV->SetSelection(aSel); + + rUndoMgr.LeaveListAction(); + + // show changes + pOL->SetUpdateMode(TRUE); + pOV->ShowCursor(); + */ + } +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx new file mode 100644 index 000000000000..e73815c51b01 --- /dev/null +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -0,0 +1,676 @@ +/************************************************************************* + * + * $RCSfile: ChartController_Properties.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ChartController.hxx" + +#include "DrawModelWrapper.hxx" +#include "chartview/ChartView.hxx" +#include "chartview/ObjectIdentifier.hxx" + +#include "SchSlotIds.hxx" + +#include "dlg_ObjectProperties.hxx" +#include "ViewElementListProvider.hxx" +#include "DataPointItemConverter.hxx" +#include "AxisItemConverter.hxx" +#include "MultipleItemConverter.hxx" +#include "TitleItemConverter.hxx" +#include "ChartModelHelper.hxx" +#include "MeterHelper.hxx" +#include "macros.hxx" +#include "TitleHelper.hxx" + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XAXISCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XAxisContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTDOCUMENT_HPP_ +#include <drafts/com/sun/star/chart2/XChartDocument.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XGRIDCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XGridContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XIDENTIFIABLE_HPP_ +#include <drafts/com/sun/star/chart2/XIdentifiable.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTITLED_HPP_ +#include <drafts/com/sun/star/chart2/XTitled.hpp> +#endif + +//for auto_ptr +#include <memory> + +// for test in executeDispatch_ObjectToDefault +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/beans/PropertyAttribute.hpp> + +// header for define RET_OK +#ifndef _SV_MSGBOX_HXX +#include <vcl/msgbox.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +namespace +{ + +uno::Reference< beans::XPropertySet > getObjectPropertySet( const rtl::OUString& rObjectCID + , const uno::Reference< frame::XModel >& xModel ) +{ + if(!rObjectCID.getLength()) + return NULL; + if(!xModel.is()) + return NULL; + + uno::Reference< beans::XPropertySet > xObjectProperties = NULL; + try + { + ObjectType eObjectType = ObjectIdentifier::getObjectType( rObjectCID ); + rtl::OUString aParticleID = ObjectIdentifier::getParticleID( rObjectCID ); + switch(eObjectType) + { + case OBJECTTYPE_PAGE: + break; + case OBJECTTYPE_TITLE: + { + if( TitleHelper::getIdentifierForTitle(TitleHelper::MAIN_TITLE).equals( aParticleID ) ) + xObjectProperties.set( TitleHelper::getTitle(TitleHelper::MAIN_TITLE,xModel), uno::UNO_QUERY ); + } + break; + case OBJECTTYPE_LEGEND: + break; + case OBJECTTYPE_LEGEND_ENTRY: + break; + case OBJECTTYPE_DIAGRAM: + break; + case OBJECTTYPE_DIAGRAM_WALL: + { + uno::Reference< XDiagram > xDia( ChartModelHelper::findDiagram( xModel ) ); + if( xDia.is()) + xObjectProperties.set( xDia->getWall() ); + } + break; + case OBJECTTYPE_DIAGRAM_FLOOR: + break; + case OBJECTTYPE_AXIS: + { + uno::Reference< XAxisContainer > xAxisCnt( ChartModelHelper::findDiagram(xModel), uno::UNO_QUERY ); + if( xAxisCnt.is()) + xObjectProperties.set( + xAxisCnt->getAxisByIdentifier( aParticleID ), + uno::UNO_QUERY ); + } + break; + case OBJECTTYPE_AXIS_UNITLABEL: + break; + case OBJECTTYPE_GRID: + { + uno::Reference< XGridContainer > xGridCnt( ChartModelHelper::findDiagram(xModel), uno::UNO_QUERY ); + if( xGridCnt.is()) + xObjectProperties.set( + xGridCnt->getGridByIdentifier( aParticleID ), + uno::UNO_QUERY ); + } + break; + case OBJECTTYPE_DATA_LABELS: + case OBJECTTYPE_DATA_SERIES: + { + uno::Reference< XDataSeries > xSeries = + ChartModelHelper::getSeriesByIdentifier( aParticleID, xModel ); + if(xSeries.is()) + xObjectProperties = uno::Reference< beans::XPropertySet >( + xSeries, uno::UNO_QUERY ); + break; + } + case OBJECTTYPE_DATA_LABEL: + case OBJECTTYPE_DATA_POINT: + { + rtl::OUString aSeriesID = ObjectIdentifier::getParentParticleID( rObjectCID ); + + uno::Reference< XDataSeries > xSeries = + ChartModelHelper::getSeriesByIdentifier( aSeriesID, xModel ); + if(xSeries.is()) + { + sal_Int32 nIndex = aParticleID.toInt32(); + xObjectProperties = xSeries->getDataPointByIndex( nIndex ); + } + break; + } + case OBJECTTYPE_DATA_ERRORS: + break; + case OBJECTTYPE_DATA_ERRORS_X: + break; + case OBJECTTYPE_DATA_ERRORS_Y: + break; + case OBJECTTYPE_DATA_ERRORS_Z: + break; + case OBJECTTYPE_DATA_FUNCTION: + break; + case OBJECTTYPE_DATA_STOCK_RANGE: + break; + case OBJECTTYPE_DATA_STOCK_LOSS: + break; + case OBJECTTYPE_DATA_STOCK_GAIN: + break; + default: //OBJECTTYPE_UNKNOWN + break; + } + } + catch( uno::Exception& ex) + { + ex; + } + return xObjectProperties; +} + +wrapper::ItemConverter* createItemConverter( + const ::rtl::OUString & aObjectCID + , const uno::Reference< frame::XModel > & xModel + , SdrModel & rDrawModel + , NumberFormatterWrapper * pNumberFormatterWrapper = NULL + , ExplicitValueProvider * pExplicitValueProvider = NULL + ) +{ + wrapper::ItemConverter* pItemConverter=NULL; + + //------------------------------------------------------------- + //get type of selected object + ObjectType eObjectType = ObjectIdentifier::getObjectType( aObjectCID ); + if( OBJECTTYPE_UNKNOWN==eObjectType ) + { + DBG_ERROR("unknown ObjectType"); + return NULL; + } + //-- + rtl::OUString aParticleID = ObjectIdentifier::getParticleID( aObjectCID ); + bool bAffectsMultipleObjects = aParticleID.equals(C2U("ALLELEMENTS")); + //------------------------------------------------------------- + if( !bAffectsMultipleObjects ) + { + uno::Reference< beans::XPropertySet > xObjectProperties= getObjectPropertySet( aObjectCID, xModel ); + if(!xObjectProperties.is()) + return NULL; + //create itemconverter for a single object + switch(eObjectType) + { + case OBJECTTYPE_PAGE: + break; + case OBJECTTYPE_TITLE: + pItemConverter = new wrapper::TitleItemConverter( xObjectProperties, + rDrawModel.GetItemPool(), + rDrawModel ); + break; + case OBJECTTYPE_LEGEND: + break; + case OBJECTTYPE_LEGEND_ENTRY: + break; + case OBJECTTYPE_DIAGRAM: + break; + case OBJECTTYPE_DIAGRAM_WALL: + pItemConverter = new wrapper::GraphicPropertyItemConverter( + xObjectProperties, rDrawModel.GetItemPool(), + rDrawModel, + wrapper::GraphicPropertyItemConverter::LINE_AND_FILL_PROPERTIES ); + break; + case OBJECTTYPE_DIAGRAM_FLOOR: + break; + case OBJECTTYPE_AXIS: + { + uno::Reference< beans::XPropertySet > xDiaProp; + xDiaProp.set( ChartModelHelper::findDiagram( xModel ), uno::UNO_QUERY ); + + // the second property set contains the property CoordinateOrigin + // nOriginIndex is the index of the corresponding index of the + // origin (x=0, y=1, z=2) + + ExplicitScaleData aExplicitScale; + ExplicitIncrementData aExplicitIncrement; + double fExplicitOrigin; + if( pExplicitValueProvider ) + pExplicitValueProvider->getExplicitValuesForMeter( + uno::Reference< XMeter >( xObjectProperties, uno::UNO_QUERY ), + aExplicitScale, aExplicitIncrement, fExplicitOrigin ); + + pItemConverter = new wrapper::AxisItemConverter( + xObjectProperties, rDrawModel.GetItemPool(), + rDrawModel, + pNumberFormatterWrapper, + &aExplicitScale, &aExplicitIncrement, &fExplicitOrigin ); + } + break; + case OBJECTTYPE_AXIS_UNITLABEL: + break; + case OBJECTTYPE_GRID: + pItemConverter = new wrapper::GraphicPropertyItemConverter( + xObjectProperties, rDrawModel.GetItemPool(), + rDrawModel, + wrapper::GraphicPropertyItemConverter::LINE_PROPERTIES ); + break; + case OBJECTTYPE_DATA_LABELS: + case OBJECTTYPE_DATA_SERIES: + pItemConverter = new wrapper::DataPointItemConverter( + xObjectProperties, rDrawModel.GetItemPool(), rDrawModel, + pNumberFormatterWrapper ); + break; + case OBJECTTYPE_DATA_LABEL: + case OBJECTTYPE_DATA_POINT: + pItemConverter = new wrapper::DataPointItemConverter( + xObjectProperties, rDrawModel.GetItemPool(), rDrawModel, + pNumberFormatterWrapper ); + break; + case OBJECTTYPE_DATA_ERRORS: + break; + case OBJECTTYPE_DATA_ERRORS_X: + break; + case OBJECTTYPE_DATA_ERRORS_Y: + break; + case OBJECTTYPE_DATA_ERRORS_Z: + break; + case OBJECTTYPE_DATA_FUNCTION: + break; + case OBJECTTYPE_DATA_STOCK_RANGE: + break; + case OBJECTTYPE_DATA_STOCK_LOSS: + break; + case OBJECTTYPE_DATA_STOCK_GAIN: + break; + default: //OBJECTTYPE_UNKNOWN + break; + } + } + else + { + //create itemconverter for a all objects of given type + switch(eObjectType) + { + case OBJECTTYPE_TITLE: + break; + case OBJECTTYPE_AXIS: + pItemConverter = new wrapper::AllAxisItemConverter( xModel, rDrawModel.GetItemPool(), + rDrawModel ); + break; + case OBJECTTYPE_GRID: + pItemConverter = new wrapper::AllGridItemConverter( xModel, rDrawModel.GetItemPool(), + rDrawModel ); + break; + default: //for this type it is not supported to change all elements at once + break; + } + + } + return pItemConverter; +} + +rtl::OUString getTitleIDForSlotId( sal_Int32 nSlotID, const uno::Reference< XChartDocument > & xChartDocument ) +{ + rtl::OUString aRet; + switch(nSlotID) + { + //@todo get id for special objects + case SID_DIAGRAM_TITLE_MAIN: + aRet = TitleHelper::getIdentifierForTitle(TitleHelper::MAIN_TITLE); + break; + case SID_DIAGRAM_TITLE_SUB: + aRet = TitleHelper::getIdentifierForTitle(TitleHelper::SUB_TITLE); + break; + case SID_DIAGRAM_TITLE_X: + aRet = TitleHelper::getIdentifierForTitle(TitleHelper::X_AXIS_TITLE); + break; + case SID_DIAGRAM_TITLE_Y: + aRet = TitleHelper::getIdentifierForTitle(TitleHelper::Y_AXIS_TITLE); + break; + case SID_DIAGRAM_TITLE_Z: + aRet = TitleHelper::getIdentifierForTitle(TitleHelper::Z_AXIS_TITLE); + break; + case SID_DIAGRAM_TITLE_ALL: + break; + default: + break; + } + return aRet; +} + +rtl::OUString getAxisIDForSlotId( sal_Int32 nSlotID, const uno::Reference< XDiagram >& xDiagram ) +{ + if( (sal_Int32)SID_DIAGRAM_AXIS_ALL == nSlotID ) + return rtl::OUString(); + + sal_Int32 nDimensionIndex=0; + bool bMainAxis=true; + switch( nSlotID ) + { + case (sal_Int32)SID_DIAGRAM_AXIS_X: + nDimensionIndex=0; bMainAxis=true; break; + case (sal_Int32)SID_DIAGRAM_AXIS_Y: + nDimensionIndex=1; bMainAxis=true; break; + case (sal_Int32)SID_DIAGRAM_AXIS_Z: + nDimensionIndex=2; bMainAxis=true; break; + case (sal_Int32)SID_DIAGRAM_AXIS_A: + nDimensionIndex=0; bMainAxis=false; break; + case (sal_Int32)SID_DIAGRAM_AXIS_B: + nDimensionIndex=1; bMainAxis=false; break; + default: + break; + } + uno::Reference< XAxis > xAxis = MeterHelper::getAxis( nDimensionIndex, bMainAxis, xDiagram ); + + uno::Reference< XIdentifiable > xIdent( xAxis, uno::UNO_QUERY ); + if( xIdent.is() ) + return xIdent->getIdentifier(); + return rtl::OUString(); +} + +rtl::OUString getGridIDForSlotId( sal_Int32 nSlotID, const uno::Reference< XDiagram >& xDiagram ) +{ + if( (sal_Int32)SID_DIAGRAM_GRID_ALL == nSlotID ) + return rtl::OUString(); + + sal_Int32 nDimensionIndex=0; + bool bMainGrid=true; + switch( nSlotID ) + { + case (sal_Int32)SID_DIAGRAM_GRID_X_MAIN: + nDimensionIndex=0; bMainGrid=true; break; + case (sal_Int32)SID_DIAGRAM_GRID_X_HELP: + nDimensionIndex=0; bMainGrid=false; break; + case (sal_Int32)SID_DIAGRAM_GRID_Y_MAIN: + nDimensionIndex=1; bMainGrid=true; break; + case (sal_Int32)SID_DIAGRAM_GRID_Y_HELP: + nDimensionIndex=1; bMainGrid=false; break; + case (sal_Int32)SID_DIAGRAM_GRID_Z_MAIN: + nDimensionIndex=2; bMainGrid=true; break; + case (sal_Int32)SID_DIAGRAM_GRID_Z_HELP: + nDimensionIndex=2; bMainGrid=false; break; + default: + break; + } + uno::Reference< XGrid > xGrid = MeterHelper::getGrid( nDimensionIndex, bMainGrid, xDiagram ); + + uno::Reference< XIdentifiable > xIdent( xGrid, uno::UNO_QUERY ); + if( xIdent.is() ) + return xIdent->getIdentifier(); + return rtl::OUString(); +} + +rtl::OUString getObjectCIDForSlotId( sal_Int32 nSlotID, const uno::Reference< XChartDocument > & xChartDocument ) +{ + ObjectType eObjectType; + rtl::OUString aParticleID; + + if( (sal_Int32)SID_DIAGRAM_TITLE_MAIN == nSlotID + || (sal_Int32)SID_DIAGRAM_TITLE_SUB == nSlotID + || (sal_Int32)SID_DIAGRAM_TITLE_X == nSlotID + || (sal_Int32)SID_DIAGRAM_TITLE_Y == nSlotID + || (sal_Int32)SID_DIAGRAM_TITLE_Z == nSlotID + || (sal_Int32)SID_DIAGRAM_TITLE_ALL == nSlotID ) + { + eObjectType = OBJECTTYPE_TITLE; + aParticleID = getTitleIDForSlotId( nSlotID, xChartDocument ); + } + else if( (sal_Int32)SID_DIAGRAM_AXIS_X == nSlotID + || (sal_Int32)SID_DIAGRAM_AXIS_Y == nSlotID + || (sal_Int32)SID_DIAGRAM_AXIS_Z == nSlotID + || (sal_Int32)SID_DIAGRAM_AXIS_A == nSlotID //secondary x axis + || (sal_Int32)SID_DIAGRAM_AXIS_B == nSlotID + || (sal_Int32)SID_DIAGRAM_AXIS_ALL == nSlotID ) + { + eObjectType = OBJECTTYPE_AXIS; + aParticleID = getAxisIDForSlotId( nSlotID, xChartDocument->getDiagram() ); + } + else if( (sal_Int32)SID_DIAGRAM_GRID_X_MAIN == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_Y_MAIN == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_Z_MAIN == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_X_HELP == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_Y_HELP == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_Z_HELP == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_ALL == nSlotID ) + { + eObjectType = OBJECTTYPE_GRID; + aParticleID = getGridIDForSlotId( nSlotID, xChartDocument->getDiagram() ); + } + else if( (sal_Int32)SID_LEGEND == nSlotID ) + { + eObjectType = OBJECTTYPE_LEGEND; + //@todo set particular aParticleID if we have more than one legend + } + else if( (sal_Int32)SID_DIAGRAM_WALL == nSlotID ) + { + //OBJECTTYPE_DIAGRAM; + eObjectType = OBJECTTYPE_DIAGRAM_WALL; + //@todo set particular aParticleID if we have more than one diagram + } + else if( (sal_Int32)SID_DIAGRAM_FLOOR == nSlotID ) + { + eObjectType = OBJECTTYPE_DIAGRAM_FLOOR; + //@todo set particular aParticleID if we have more than one diagram + } + else if( (sal_Int32)SID_DIAGRAM_AREA == nSlotID ) + { + eObjectType = OBJECTTYPE_PAGE; + } + + if( (sal_Int32)SID_DIAGRAM_TITLE_ALL == nSlotID + || (sal_Int32)SID_DIAGRAM_AXIS_ALL == nSlotID + || (sal_Int32)SID_DIAGRAM_GRID_ALL == nSlotID ) + { + aParticleID = C2U("ALLELEMENTS"); + } + return ObjectIdentifier::createClassifiedIdentifier( + eObjectType, aParticleID ); +} + +} +// anonymous namespace + +void SAL_CALL ChartController::executeDispatch_FormatObject(sal_Int32 nSlotID) +{ + uno::Reference< XChartDocument > xChartDocument( m_aModel->getModel(), uno::UNO_QUERY ); + rtl::OUString rObjectCID = getObjectCIDForSlotId( nSlotID, xChartDocument ); + executeDlg_ObjectProperties( rObjectCID ); +} + +void SAL_CALL ChartController::executeDispatch_ObjectProperties() +{ + executeDlg_ObjectProperties( m_aSelectedObjectCID ); +} + +void SAL_CALL ChartController::executeDlg_ObjectProperties( const ::rtl::OUString& rObjectCID ) +{ + bool bChanged = false; + if( !rObjectCID.getLength() ) + { + //DBG_ERROR("empty ObjectID"); + return; + } + try + { + //------------------------------------------------------------- + //get type of selected object + ObjectType eObjectType = ObjectIdentifier::getObjectType( rObjectCID ); + if( OBJECTTYPE_UNKNOWN==eObjectType ) + { + //DBG_ERROR("unknown ObjectType"); + return; + } + rtl::OUString aParticleID = ObjectIdentifier::getParticleID( rObjectCID ); + bool bAffectsMultipleObjects = aParticleID.equals(C2U("ALLELEMENTS")); + //------------------------------------------------------------- + //convert properties to ItemSet + ::std::auto_ptr< wrapper::ItemConverter > apItemConverter( + createItemConverter( rObjectCID, m_aModel->getModel(), + m_pDrawModelWrapper->getSdrModel(), + m_pNumberFormatterWrapper, + m_pChartView )); + if(!apItemConverter.get()) + return; + SfxItemSet aItemSet = apItemConverter->CreateEmptyItemSet(); + apItemConverter->FillItemSet( aItemSet ); + + //------------------------------------------------------------- + //prepare dialog + OldModelWrapper aOldChartModelWrapper = OldModelWrapper(); + Window* pParent( NULL ); + ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper, m_pNumberFormatterWrapper ); + Graphic aSymbolGraphic; + + SchAttribTabDlg aDlg( pParent + , eObjectType, &aItemSet + , &aViewElementListProvider, &aOldChartModelWrapper + , bAffectsMultipleObjects ); + //, pSymbolAttr, aSymbolGraphic ); + + //------------------------------------------------------------- + //open the dialog + if( aDlg.Execute() == RET_OK ) + { + const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet(); + if(pOutItemSet) + { + bChanged = apItemConverter->ApplyItemSet( *pOutItemSet );//model should be changed now + } + } + /* + pDlg = new SchAttribTabDlg(NULL, eType, &aRowAttr,pDoc->GetObjectShell() ,pDoc + , 0, pDoc->ChartStyle(),&aSymbolAttr + ,GenSymbolGraphic(pDataRow->GetRow())); + + SfxItemSet aSymbolAttr(aPointAttr); + if(pDoc->HasSymbols(pDataPoint->GetRow())) + { + pDoc->GenerateSymbolAttr(aSymbolAttr,pDataPoint->GetRow()); + pDlg = new SchAttribTabDlg(NULL, ATTR_DATA_POINT, &aPointAttr, pDoc->GetObjectShell(), pDoc + , 0, pDoc->ChartStyle(),&aSymbolAttr + ,GenSymbolGraphic(pDataPoint->GetRow(),pDataPoint->GetCol())); + } + else + { + pDlg = new SchAttribTabDlg(NULL, ATTR_DATA_POINT, &aPointAttr, pDoc->GetObjectShell(), pDoc + , 0, pDoc->ChartStyle()); + } + */ + } + catch( util::CloseVetoException& ) + { + } + catch( uno::RuntimeException& ) + { + } + + try + { + //make sure that all objects using m_pDrawModelWrapper or m_pChartView are already deleted + if(bChanged) + impl_rebuildView(); + } + catch( uno::RuntimeException& e) + { + e; + } +} + +void SAL_CALL ChartController::executeDispatch_ObjectToDefault() +{ + if( !m_aSelectedObjectCID.getLength() ) + { + DBG_ERROR("nothing is selected"); + return; + } + + try + { + //------------------------------------------------------------- + //get type of selected object + ObjectType eObjectType = ObjectIdentifier::getObjectType( m_aSelectedObjectCID ); + if( OBJECTTYPE_UNKNOWN==eObjectType ) + { + DBG_ERROR("unknown ObjectType"); + return; + } + //------------------------------------------------------------- + //get properties of selected object + uno::Reference< beans::XPropertySet > xObjectProperties = NULL; + xObjectProperties = getObjectPropertySet( m_aSelectedObjectCID, getModel() ); + if(!xObjectProperties.is()) + return; + + uno::Sequence< beans::Property > aProps( xObjectProperties->getPropertySetInfo()->getProperties() ); + uno::Reference< beans::XPropertyState > xState( xObjectProperties, uno::UNO_QUERY ); + + for( sal_Int32 i = 0; i < aProps.getLength(); ++i ) + { + if( aProps[i].Attributes & beans::PropertyAttribute::MAYBEDEFAULT ) + xState->setPropertyToDefault( aProps[i].Name ); + } + + impl_rebuildView(); + } + catch( uno::Exception& ) + { + DBG_ERROR( "Exception caught" ); + } +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx new file mode 100644 index 000000000000..039be56c98e7 --- /dev/null +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -0,0 +1,659 @@ +/************************************************************************* + * + * $RCSfile: ChartController_Window.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ChartController.hxx" +#include "SelectionHelper.hxx" +#include "ChartWindow.hxx" +#include "chartview/ChartView.hxx" +#include "Chart.hrc" +#include "ResId.hxx" +// header for class PopupMenu +#ifndef _SV_MENU_HXX +#include <vcl/menu.hxx> +#endif +#include "macros.hxx" +#include "SchSlotIds.hxx" +#ifndef _SVX_SVXIDS_HRC +#include <svx/svxids.hrc> +#endif + +#define DRGPIX 2 // Drag MinMove in Pixel + +//............................................................................. +namespace chart +{ +//............................................................................. + +using namespace ::com::sun::star; +//using namespace ::drafts::com::sun::star::chart2; + +//----------------------------------------------------------------- +// awt::XWindow +//----------------------------------------------------------------- + void SAL_CALL ChartController +::setPosSize( sal_Int32 X, sal_Int32 Y + , sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->setPosSize( X, Y, Width, Height, Flags ); +} + + awt::Rectangle SAL_CALL ChartController +::getPosSize() + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + return xWindow->getPosSize(); + return awt::Rectangle(0,0,0,0); +} + + void SAL_CALL ChartController +::setVisible( sal_Bool Visible ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->setVisible( Visible ); +} + + void SAL_CALL ChartController +::setEnable( sal_Bool Enable ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->setEnable( Enable ); +} + + void SAL_CALL ChartController +::setFocus() throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->setFocus(); +} + + void SAL_CALL ChartController +::addWindowListener( const uno::Reference< + awt::XWindowListener >& xListener ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->addWindowListener( xListener ); +} + + void SAL_CALL ChartController +::removeWindowListener( const uno::Reference< + awt::XWindowListener >& xListener ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->removeWindowListener( xListener ); +} + + void SAL_CALL ChartController +::addFocusListener( const uno::Reference< + awt::XFocusListener >& xListener ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->addFocusListener( xListener ); +} + + void SAL_CALL ChartController +::removeFocusListener( const uno::Reference< + awt::XFocusListener >& xListener ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->removeFocusListener( xListener ); +} + + void SAL_CALL ChartController +::addKeyListener( const uno::Reference< + awt::XKeyListener >& xListener ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->addKeyListener( xListener ); +} + + void SAL_CALL ChartController +::removeKeyListener( const uno::Reference< + awt::XKeyListener >& xListener ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->removeKeyListener( xListener ); +} + + void SAL_CALL ChartController +::addMouseListener( const uno::Reference< + awt::XMouseListener >& xListener ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->addMouseListener( xListener ); +} + + void SAL_CALL ChartController +::removeMouseListener( const uno::Reference< + awt::XMouseListener >& xListener ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->removeMouseListener( xListener ); +} + + void SAL_CALL ChartController +::addMouseMotionListener( const uno::Reference< + awt::XMouseMotionListener >& xListener ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->addMouseMotionListener( xListener ); +} + + void SAL_CALL ChartController +::removeMouseMotionListener( const uno::Reference< + awt::XMouseMotionListener >& xListener ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->removeMouseMotionListener( xListener ); +} + + void SAL_CALL ChartController +::addPaintListener( const uno::Reference< + awt::XPaintListener >& xListener ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->addPaintListener( xListener ); +} + + void SAL_CALL ChartController +::removePaintListener( const uno::Reference< + awt::XPaintListener >& xListener ) + throw (uno::RuntimeException) +{ + //@todo + uno::Reference<awt::XWindow> xWindow = m_xViewWindow; + + if(xWindow.is()) + xWindow->removePaintListener( xListener ); +} + +//----------------------------------------------------------------- +// impl vcl window controller methods +//----------------------------------------------------------------- +void ChartController::execute_Paint( const Rectangle& rRect ) +{ + //Window::Paint(rRect); + //??? @todo initialize doc if not ready or update view state if not ready and invalidate all + + if(m_bViewDirty) + { + impl_rebuildView(); + return; + } + + Window* pWindow = m_pChartWindow; + DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper; + pDrawViewWrapper->InitRedraw(pWindow, Region(rRect) ); +} + +bool isDoubleClick( const MouseEvent& rMEvt ) +{ + return rMEvt.GetClicks() == 2 && rMEvt.IsLeft() && + !rMEvt.IsMod1() && !rMEvt.IsMod2() && !rMEvt.IsShift(); +} + +void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt ) +{ + Window* pWindow = m_pChartWindow; + DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper; + + Point aMPos = pWindow->PixelToLogic(rMEvt.GetPosPixel()); + + if ( MOUSE_LEFT == rMEvt.GetButtons() ) + { + pWindow->GrabFocus(); + pWindow->CaptureMouse(); + } + + //old chart: + //ForcePointer(&rMEvt); //shouldn't be necessary if pointer was set correct in mousemove .... + //SuspendSelectionChangeBroadcasting aSelectionSuspender( pViewShell ); + //pViewShell->SetMousePos( aMPos ); + + //??? select Fu ( SchFuDraw SchFuText SchFuSelection ) and call MouseButtonDown there + + //abort running action + if( pDrawViewWrapper->IsAction() ) + { + if( rMEvt.IsRight() ) + pDrawViewWrapper->BckAction(); + return; + } + + //selection + if( !isDoubleClick(rMEvt) && !rMEvt.IsRight() ) //do not change selection if double click or right click + { + pDrawViewWrapper->UnmarkAll(); + SdrObject* pNewObj = SelectionHelper::getObjectToSelect( + aMPos, m_aSelectedObjectCID + , *pDrawViewWrapper ); + if(!pNewObj) + return; + SelectionHelper aSelectionHelper( pNewObj, m_aSelectedObjectCID ); + SdrObject* pMarkObj = aSelectionHelper.getObjectToMark(); + pDrawViewWrapper->setMarkHandleProvider(&aSelectionHelper); + pDrawViewWrapper->MarkObject(pMarkObj); + pDrawViewWrapper->setMarkHandleProvider(NULL); + } + + //dragging + if(false) + { + SdrDragMode eDragMode(SDRDRAG_MOVE);//SDRDRAG_CREATE,SDRDRAG_MOVE,SDRDRAG_RESIZE,SDRDRAG_ROTATE,SDRDRAG_MIRROR,SDRDRAG_SHEAR,SDRDRAG_CROOK + + pDrawViewWrapper->SetDragMode(eDragMode); + SdrHdl* pHdl = NULL;//pDrawViewWrapper->PickHandle( aMPos, *pWindow ); + USHORT nDrgLog = (USHORT)pWindow->PixelToLogic(Size(DRGPIX,0)).Width(); + pDrawViewWrapper->BegDragObj(aMPos, NULL, pHdl, nDrgLog); + } + + //pDrawViewWrapper->UnmarkAll(); + //pDrawViewWrapper->GetPageViewPvNum(0)->GetEnteredLevel() + //pDrawViewWrapper->IsMarkedHit(aMPos, nHitLog) + //pDrawViewWrapper->HasMarkedObj(); + //pDrawViewWrapper->MarkLogicalGroup(); + //pDrawViewWrapper->EnterMarkedGroup(); + //pDrawViewWrapper->LeaveOneGroup(); + + //pDrawViewWrapper->MovAction( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) ); + //pDrawViewWrapper->EndAction(); + + //pDrawViewWrapper->IsDragObj(); + //pDrawViewWrapper->EndDragObj(rMEvt.IsMod1()); + //pDrawViewWrapper->SetDragWithCopy( rMEvt.IsMod1()); + //pDrawViewWrapper->GetDragMode() + //pDrawViewWrapper->SetEditMode(FALSE); + + //pDrawViewWrapper->GetPageView()->DragPoly() ; + + //pView->BeginDrag(pWindow, aMPos); + + + //if(!pFunction) //if no Fu active/set ... + // Window::MouseButtonDown(rMEvt); +} + +// Timer-Handler fuer Drag&Drop +/* +IMPL_LINK( ChartWindow, DragHdl, Timer *, pTimer ) +{ + *//* + USHORT nHitLog = (USHORT)pWindow->PixelToLogic(Size(HITPIX,0)).Width(); + SdrHdl* pHdl = pView->HitHandle(aMPos, *pWindow); + + if (pHdl==NULL && pView->IsMarkedHit(aMPos, nHitLog)) + { + pWindow->ReleaseMouse(); + m_bIsInDragMode = TRUE; + + pView->BeginDrag(pWindow, aMPos); + } + *//* + this->ReleaseMouse(); + return 0; +} +*/ + +void ChartController::execute_MouseMove( const MouseEvent& rMEvt ) +{ + Window* pWindow = m_pChartWindow; + DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper; + if(!pDrawViewWrapper) + return; + + //ForcePointer(&rMEvt); should be sufficient and correct to do it at the end + //??? select Fu ( SchFuDraw SchFuText SchFuSelection ) and call MouseMove there + +/* + if(m_aDragTimer.IsActive()) + { + m_aDragTimer.Stop(); + m_bIsInDragMode = FALSE; + } +*/ + + if(pDrawViewWrapper->IsAction()) + pDrawViewWrapper->MovAction( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) ); + + //text: pView->MouseMove(rMEvt, pWindow) // Event von der SdrView ausgewertet + //?? pDrawViewWrapper->GetPageView()->DragPoly(); + + //if(!pFunction) //if no Fu active/set ... + // Window::MouseMove(rMEvt); + + //@todo ForcePointer(&rMEvt); +} +void ChartController::execute_Tracking( const TrackingEvent& rTEvt ) +{ +} +void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt ) +{ + Window* pWindow = m_pChartWindow; + DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper; + + //??? select Fu ( SchFuDraw SchFuText SchFuSelection ) and call MouseButtonUp there + //---------------------------- + /* + uno::Reference< uno::XInterface > xI; + uno::Reference< drawing::XShape > xShape; + uno::Reference< beans::XPropertySet > xShapeProps; + + if(s_pObj) + { + xI = s_pObj->getUnoShape(); + xShape = uno::Reference<drawing::XShape>( xI, uno::UNO_QUERY ); + xShapeProps = uno::Reference<beans::XPropertySet>( xI, uno::UNO_QUERY ); + } + + awt::Point aOldPoint; + awt::Point aNewPoint; + awt::Size aOldSize; + awt::Size aNewSize; + drawing::HomogenMatrix3 aOldMatrix; + drawing::HomogenMatrix3 aNewMatrix; + + if(xShape.is()) + { + aOldPoint = xShape->getPosition(); + aOldSize = xShape->getSize(); + } + if(xShapeProps.is()) + { + uno::Any aVal = xShapeProps->getPropertyValue( + ::rtl::OUString::createFromAscii("Transformation") ); + aVal >>= aOldMatrix; + } + */ + //---------------------------- + + if(!pDrawViewWrapper) + return; + if(pDrawViewWrapper->IsDragObj()) + { + if( pDrawViewWrapper->EndDragObj(rMEvt.IsMod1()) ) + { + + /* + if(xShape.is()) + { + aNewPoint = xShape->getPosition(); + aNewSize = xShape->getSize(); + } + if(xShapeProps.is()) + { + uno::Any aVal = xShapeProps->getPropertyValue( + ::rtl::OUString::createFromAscii("Transformation") ); + aVal >>= aNewMatrix; + } + */ + + pDrawViewWrapper->SetDragWithCopy( rMEvt.IsMod1()); + } + } + + pWindow->ReleaseMouse(); + + //if(pDrawViewWrapper->IsAction()) + // pDrawViewWrapper->EndAction(); + + /* SchFuText: + SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings(); + + rBindings.Invalidate(SID_CUT); + rBindings.Invalidate(SID_COPY); + + if (pView->MouseButtonUp(rMEvt, pWindow)) + return TRUE; // Event von der SdrView ausgewertet + + */ + if( isDoubleClick(rMEvt) ) + execute_DoubleClick(); + + //if(!pFunction) //if no Fu active/set ... + // Window::MouseButtonUp(rMEvt); + + //@todo ForcePointer(&rMEvt); + //pWindow->ReleaseMouse(); +} + +void ChartController::execute_DoubleClick() +{ + executeDispatch_ObjectProperties(); +} + +void ChartController::execute_Resize() +{ + m_bViewDirty = true; + m_pChartWindow->Invalidate(); +} +void ChartController::execute_Activate() +{ + ///// pDrawViewWrapper->SetEditMode(TRUE); +} +void ChartController::execute_Deactivate() +{ + /* + m_aDragTimer.Stop(); + + pDrawViewWrapper->SetEditMode(FALSE); + + this->ReleaseMouse(); + */ +} +void ChartController::execute_GetFocus() +{ +} +void ChartController::execute_LoseFocus() +{ + //this->ReleaseMouse(); +} +util::URL createDispatchURL( USHORT nSID ) +{ + util::URL aRet; + aRet.Protocol = C2U("slot:"); + aRet.Path = rtl::OUString::valueOf((sal_Int32)nSID); + return aRet; +} +void ChartController::execute_Command( const CommandEvent& rCEvt ) +{ + // pop-up menu + if (rCEvt.GetCommand() == COMMAND_CONTEXTMENU && !m_pDrawViewWrapper->IsAction()) + { + m_pChartWindow->ReleaseMouse(); + + BOOL bAxisChart = true;//@todo get from somewhere + BOOL bIs3DChart = false;//@todo get from somewhere + BOOL bHasOwnData = false; + BOOL bHasSomethingToPaste = true; + + USHORT nRId = 0; + if( !m_aSelectedObjectCID.getLength() ) + nRId = RID_FORMAT_POPUP; + else + nRId = RID_OBJECT_POPUP; + + PopupMenu aMenu=PopupMenu ( SchResId( nRId ) ); + if(!bIs3DChart) + { + aMenu.RemoveItem( aMenu.GetItemPos( SID_DIAGRAM_FLOOR ) ); + aMenu.RemoveItem( aMenu.GetItemPos( SID_3D_WIN ) ); + } + if(!bAxisChart) + { + aMenu.RemoveItem( aMenu.GetItemPos( SID_INSERT_AXIS ) ); + aMenu.RemoveItem( aMenu.GetItemPos( SID_INSERT_GRIDS ) ); + aMenu.RemoveItem( aMenu.GetItemPos( SID_DIAGRAM_WALL ) ); + aMenu.RemoveItem( aMenu.GetItemPos( SID_DIAGRAM_FLOOR ) ); + } + if(!bHasOwnData) + { + aMenu.RemoveItem( aMenu.GetItemPos( SID_DIAGRAM_DATA ) ); + } + if( !bHasSomethingToPaste ) + { + aMenu.RemoveItem( aMenu.GetItemPos( SID_PASTE ) ); + } + + USHORT nId = aMenu.Execute( m_pChartWindow, rCEvt.GetMousePosPixel() ); + util::URL aURL( createDispatchURL( nId ) ); + uno::Sequence< beans::PropertyValue > aArgs; + this->dispatch( aURL, aArgs ); + } +} +//----------------------------------------------------------------- +// XSelectionSupplier (optional interface) +//----------------------------------------------------------------- + sal_Bool SAL_CALL ChartController +::select( const uno::Any& rSelection ) + throw( lang::IllegalArgumentException ) +{ + //@todo + return sal_False; +} + + uno::Any SAL_CALL ChartController +::getSelection() throw(uno::RuntimeException) +{ + //@todo + return uno::Any(); +} + + void SAL_CALL ChartController +::addSelectionChangeListener( const uno::Reference< + view::XSelectionChangeListener > & xListener ) + throw(uno::RuntimeException) +{ + //@todo +} + + void SAL_CALL ChartController +::removeSelectionChangeListener( const uno::Reference< + view::XSelectionChangeListener > & xListener ) + throw(uno::RuntimeException) +{ + //@todo +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/main/ChartFrameloader.cxx b/chart2/source/controller/main/ChartFrameloader.cxx new file mode 100644 index 000000000000..fc80e73c6dcd --- /dev/null +++ b/chart2/source/controller/main/ChartFrameloader.cxx @@ -0,0 +1,211 @@ +/************************************************************************* + * + * $RCSfile: ChartFrameloader.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ChartFrameloader.hxx" +#include "servicenames.hxx" +#include "MediaDescriptorHelper.hxx" + +//............................................................................. +namespace chart +{ +//............................................................................. + +using namespace ::com::sun::star; + +ChartFrameLoader::ChartFrameLoader( + uno::Reference<uno::XComponentContext> const & xContext) + : m_bCancelRequired( sal_False ) +{ + m_xCC = xContext; + m_oCancelFinished.reset(); +} + +ChartFrameLoader::~ChartFrameLoader() +{ +} + + sal_Bool ChartFrameLoader +::impl_checkCancel() +{ + if(m_bCancelRequired) + { + m_oCancelFinished.set(); + return sal_True; + } + return sal_False; +} + +//----------------------------------------------------------------- +// lang::XServiceInfo +//----------------------------------------------------------------- + +APPHELPER_XSERVICEINFO_IMPL(ChartFrameLoader,CHART_FRAMELOADER_SERVICE_IMPLEMENTATION_NAME) + + uno::Sequence< rtl::OUString > ChartFrameLoader +::getSupportedServiceNames_Static() +{ + uno::Sequence< rtl::OUString > aSNS( 1 ); + aSNS.getArray()[ 0 ] = CHART_FRAMELOADER_SERVICE_NAME; + return aSNS; +} + +//----------------------------------------------------------------- +// frame::XFrameLoader +//----------------------------------------------------------------- + + sal_Bool SAL_CALL ChartFrameLoader +::load( const uno::Sequence< beans::PropertyValue >& rMediaDescriptor + , const uno::Reference<frame::XFrame >& xFrame ) + throw (uno::RuntimeException) +{ + //@todo ? need to add as terminate listener to desktop? + + //create mediadescriptor to be attached to the model + apphelper::MediaDescriptorHelper aMediaDescriptorHelper(rMediaDescriptor); + + //prepare data for model ... missing interface XPersist or XLoadable at Model.... + { + //@todo ... + } + + /* + static uno::Reference< frame::XFrame > xTestFrame = uno::Reference< frame::XFrame >( + m_xCC->getServiceManager()->createInstanceWithContext( + ::rtl::OUString::createFromAscii("com.sun.star.frame.Frame"), m_xCC ) + , uno::UNO_QUERY ); + + static uno::Reference< awt::XWindow > xTestWindow = uno::Reference< awt::XWindow >( + m_xCC->getServiceManager()->createInstanceWithContext( + ::rtl::OUString::createFromAscii("com.sun.star.awt.Window"), m_xCC ) + , uno::UNO_QUERY ); + xTestFrame->initialize(xTestWindow); + */ + + //create and initialize the model + uno::Reference< frame::XModel > xModel = NULL; + { + //@todo?? load mechanism to cancel during loading of document + xModel = uno::Reference< frame::XModel >( + m_xCC->getServiceManager()->createInstanceWithContext( + CHART_MODEL_SERVICE_IMPLEMENTATION_NAME, m_xCC ) + , uno::UNO_QUERY ); + + if( impl_checkCancel() ) + return sal_False; + + //@todo load data to model ... missing interface XPersist or XLoadable at Model.... + xModel->attachResource( aMediaDescriptorHelper.URL.Complete, aMediaDescriptorHelper.getReducedForModel() ); + } + + //create the component context for the controller + uno::Reference< uno::XComponentContext > xComponentContext_ForController = NULL; + { + xComponentContext_ForController = uno::Reference< uno::XComponentContext >( + m_xCC->getServiceManager()->createInstanceWithContext( + ::rtl::OUString::createFromAscii("com.sun.star.uno.ComponentContext"), m_xCC ) + , uno::UNO_QUERY ); + + //@todo + if( impl_checkCancel() ) + return sal_False; + } + + //create the controller(+XWindow) + uno::Reference< frame::XController > xController = NULL; + uno::Reference< awt::XWindow > xComponentWindow = NULL; + { + xController = uno::Reference< frame::XController >( + m_xCC->getServiceManager()->createInstanceWithContext( + CHART_CONTROLLER_SERVICE_IMPLEMENTATION_NAME,m_xCC ) //, xComponentContext_ForController ) + , uno::UNO_QUERY ); + + //!!!it is a special characteristic of the example application + //that the controller simultaniously provides the XWindow controller functionality + xComponentWindow = + uno::Reference< awt::XWindow >( xController, uno::UNO_QUERY ); + + if( impl_checkCancel() ) + return sal_False; + } + + //connect frame, controller and model one to each other: + if(xController.is()&&xModel.is()) + { + xController->attachFrame(xFrame); + xController->attachModel(xModel); + xModel->connectController(xController); + if(xFrame.is()) + xFrame->setComponent(xComponentWindow,xController); + } + return sal_True; +} + + void SAL_CALL ChartFrameLoader +::cancel() throw (uno::RuntimeException) +{ + m_oCancelFinished.reset(); + m_bCancelRequired = sal_True; + m_oCancelFinished.wait(); + m_bCancelRequired = sal_False; +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/main/ChartFrameloader.hxx b/chart2/source/controller/main/ChartFrameloader.hxx new file mode 100644 index 000000000000..1da851b9fd82 --- /dev/null +++ b/chart2/source/controller/main/ChartFrameloader.hxx @@ -0,0 +1,136 @@ +/************************************************************************* + * + * $RCSfile: ChartFrameloader.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHARTFRAMELOADER_HXX +#define _CHARTFRAMELOADER_HXX + +#include "ServiceMacros.hxx" + +#ifndef _OSL_CONDITN_HXX_ +#include <osl/conditn.hxx> +#endif +#ifndef _COM_SUN_STAR_FRAME_XSYNCHRONOUSFRAMELOADER_HPP_ +#include <com/sun/star/frame/XSynchronousFrameLoader.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include <cppuhelper/implbase2.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +class ChartFrameLoader : public ::cppu::WeakImplHelper2< + ::com::sun::star::frame::XSynchronousFrameLoader + , ::com::sun::star::lang::XServiceInfo + //comprehends XComponent (required interface) + // ,public ::com::sun::star::uno::XWeak // implemented by WeakImplHelper(optional interface) + // ,public ::com::sun::star::uno::XInterface // implemented by WeakImplHelper(optional interface) + // ,public ::com::sun::star::lang::XTypeProvider // implemented by WeakImplHelper + > +{ +private: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xCC; + sal_Bool m_bCancelRequired; + ::osl::Condition m_oCancelFinished; + +private: + sal_Bool impl_checkCancel(); + //no default constructor + ChartFrameLoader(){}; +public: + ChartFrameLoader(::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext); + virtual ~ChartFrameLoader(); + + //----------------------------------------------------------------- + // ::com::sun::star::lang::XServiceInfo + //----------------------------------------------------------------- + + APPHELPER_XSERVICEINFO_DECL() + APPHELPER_SERVICE_FACTORY_HELPER(ChartFrameLoader) + + //----------------------------------------------------------------- + // ::com::sun::star::frame::XFrameLoader + //----------------------------------------------------------------- + + virtual sal_Bool SAL_CALL + load( const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rMediaDescriptor + ,const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XFrame >& xFrame ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + cancel() throw (::com::sun::star::uno::RuntimeException); +}; + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx new file mode 100644 index 000000000000..09f48334cf24 --- /dev/null +++ b/chart2/source/controller/main/ChartWindow.cxx @@ -0,0 +1,137 @@ +/************************************************************************* + * + * $RCSfile: ChartWindow.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ChartWindow.hxx" +#include "ChartController.hxx" + +using namespace ::com::sun::star; + +//............................................................................. +namespace chart +{ +//............................................................................. + +ChartWindow::ChartWindow( WindowController* pWindowController, Window* pParent, WinBits nStyle ) + : Window(pParent, nStyle) + , m_pWindowController( pWindowController ) +{ + this->SetMapMode( MapMode(MAP_100TH_MM) ); +} + +ChartWindow::~ChartWindow() +{ +} + +void ChartWindow::Paint( const Rectangle& rRect ) +{ + m_pWindowController->execute_Paint( rRect ); +} + +void ChartWindow::MouseButtonDown(const MouseEvent& rMEvt) +{ + m_pWindowController->execute_MouseButtonDown(rMEvt); +} + +void ChartWindow::MouseMove( const MouseEvent& rMEvt ) +{ + m_pWindowController->execute_MouseMove( rMEvt ); +} + +void ChartWindow::Tracking( const TrackingEvent& rTEvt ) +{ + m_pWindowController->execute_Tracking( rTEvt ); +} + +void ChartWindow::MouseButtonUp( const MouseEvent& rMEvt ) +{ + m_pWindowController->execute_MouseButtonUp( rMEvt ); +} + +void ChartWindow::Resize() +{ + m_pWindowController->execute_Resize(); +} + +void ChartWindow::Activate() +{ + m_pWindowController->execute_Activate(); +} + +void ChartWindow::Deactivate() +{ + m_pWindowController->execute_Deactivate(); +} + +void ChartWindow::GetFocus() +{ + m_pWindowController->execute_GetFocus(); +} + +void ChartWindow::LoseFocus() +{ + m_pWindowController->execute_LoseFocus(); +} +void ChartWindow::Command( const CommandEvent& rCEvt ) +{ + m_pWindowController->execute_Command( rCEvt ); +} +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/main/ChartWindow.hxx b/chart2/source/controller/main/ChartWindow.hxx new file mode 100644 index 000000000000..07a8db38ed4c --- /dev/null +++ b/chart2/source/controller/main/ChartWindow.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * $RCSfile: ChartWindow.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHARTWINDOW_HXX +#define _CHARTWINDOW_HXX + +#ifndef _SV_WINDOW_HXX +#include <vcl/window.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + + +class WindowController; + +//----------------------------------------------------------------------------- +/** The ChartWindow collects events from the window and forwards them the to the controller +thus the controller can perform appropriate actions +*/ + +class ChartWindow : public Window +{ +public: + ChartWindow( WindowController* pWindowController, Window* pParent, WinBits nStyle ); + virtual ~ChartWindow(); + + //from base class Window: + virtual void Paint( const Rectangle& rRect ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void Tracking( const TrackingEvent& rTEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + virtual void Resize(); + virtual void Activate(); + virtual void Deactivate(); + virtual void GetFocus(); + virtual void LoseFocus(); + virtual void Command( const CommandEvent& rCEvt ); + +private: + WindowController* m_pWindowController; +}; + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx new file mode 100644 index 000000000000..638ed4e5337c --- /dev/null +++ b/chart2/source/controller/main/SelectionHelper.cxx @@ -0,0 +1,339 @@ +/************************************************************************* + * + * $RCSfile: SelectionHelper.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "SelectionHelper.hxx" +#include "chartview/ObjectIdentifier.hxx" +//for C2U +#include "macros.hxx" + +// header for class SdrObjList +#ifndef _SVDPAGE_HXX +#include <svx/svdpage.hxx> +#endif + +#ifndef _SVDITER_HXX +#include <svx/svditer.hxx> +#endif +#ifndef _E3D_OBJ3D_HXX +#include "svx/obj3d.hxx" +#endif +// header for class SdrPathObj +#ifndef _SVDOPATH_HXX +#include <svx/svdopath.hxx> +#endif + +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +//using namespace ::drafts::com::sun::star::chart2; + +//static +rtl::OUString SelectionHelper::getObjectName( SdrObject* pObj ) +{ + rtl::OUString aName; + if(pObj) + { + try + { + uno::Reference< uno::XInterface > xShape = pObj->getUnoShape(); + uno::Reference< beans::XPropertySet > xShapeProps( + uno::Reference< beans::XPropertySet >::query( xShape ) ); + uno::Any aAName = xShapeProps->getPropertyValue( C2U( "Name" ) ); //UNO_NAME_MISC_OBJ_NAME + aAName >>= aName; + } + catch( uno::Exception &e) + { + e; + } + } + return aName; +} + +//static +bool SelectionHelper::findNamedParent( SdrObject*& pInOutObject + , rtl::OUString& rOutName + , bool bGivenObjectMayBeResult ) +{ + //find the deepest named group + SdrObject* pObj = pInOutObject; + rtl::OUString aName; + if( bGivenObjectMayBeResult ) + aName = getObjectName( pObj ); + + while( pObj && !ObjectIdentifier::isCID( aName ) ) + { + SdrObjList* pObjList = pObj->GetObjList(); + if( !pObjList ) + return false;; + SdrObject* pOwner = pObjList->GetOwnerObj(); + if( !pOwner ) + return false; + pObj = pOwner; + aName = getObjectName( pObj ); + } + + if(!pObj) + return false; + if(!aName.getLength()) + return false; + + pInOutObject = pObj; + rOutName = aName; + return true; +} + +//static +SdrObject* SelectionHelper::getObjectToSelect( const Point& rMPos + , rtl::OUString& rNameOfLastSelectedObject + , const DrawViewWrapper& rDrawViewWrapper ) +{ + //the search for the object to select starts with the hit object deepest in the grouping hierarchy (a leaf in the tree) + //further we travel along the grouping hierarchy from child to parent + SdrObject* pNewObj = rDrawViewWrapper.getHitObject(rMPos); + rtl::OUString aNewName = getObjectName( pNewObj );//name of pNewObj + rtl::OUString aTestFirstHit = aNewName; + + //ignore handle only objects for hit test + while( pNewObj && aNewName.match(C2U("HandlesOnly")) ) + { + pNewObj->SetMarkProtect(true); + pNewObj = rDrawViewWrapper.getHitObject(rMPos); + aNewName = getObjectName( pNewObj ); + } + + //accept only named objects while searching for the object to select + if( !findNamedParent( pNewObj, aNewName, true ) ) + { + rNameOfLastSelectedObject = C2U(""); + return NULL; + } + //if the so far found object is a multi click object further steps are necessary + while( ObjectIdentifier::isMultiClickObject( aNewName ) ) + { + if( rNameOfLastSelectedObject.getLength() && aNewName.match( rNameOfLastSelectedObject ) ) + { + //if the same child is clicked again don't go up further + break; + } + if( ObjectIdentifier::areSiblings(rNameOfLastSelectedObject,aNewName) ) + { + //if a sibling of the last selected object is clicked don't go up further + break; + } + SdrObject* pLastChild = pNewObj; + rtl::OUString aLastChildName = aNewName; + if(!findNamedParent( pNewObj, aNewName, false )) + { + //take the one found so far + break; + } + //if the last selected object is found don't go up further but take the last child + if( rNameOfLastSelectedObject.getLength() && aNewName.match( rNameOfLastSelectedObject ) ) + { + pNewObj = pLastChild; + aNewName = aLastChildName; + break; + } + } + DBG_ASSERT(pNewObj && aNewName.getLength(),"somehow lost selected object"); + rNameOfLastSelectedObject = aNewName; + return pNewObj; +} + + +SelectionHelper::SelectionHelper( SdrObject* pSelectedObj + , const rtl::OUString& rSelectedObjectCID ) + : m_pSelectedObj( pSelectedObj ) + , m_aSelectedObjectCID( rSelectedObjectCID ) +{ + +} +SelectionHelper::~SelectionHelper() +{ +} + +//virtual +bool SelectionHelper::getFrameDragSingles() +{ + bool bFrameDragSingles = true;//true == green == surrounding handles + if( m_pSelectedObj && m_pSelectedObj->ISA(E3dObject) ) + bFrameDragSingles = false; + return bFrameDragSingles; +} + +SdrObject* SelectionHelper::getObjectToMark() +{ + //return the selected object itself + //or a sub object if one with name "Handles" exsists + + SdrObject* pObj = m_pSelectedObj; + + m_pMarkObj = pObj; + if(pObj) + { + SdrObjList* pSubList = pObj->GetSubList(); + if(pSubList) + { + SdrObjListIter aIterator(*pSubList, IM_DEEPWITHGROUPS); + while (aIterator.IsMore()) + { + SdrObject* pSubObj = aIterator.Next(); + rtl::OUString aName = SelectionHelper::getObjectName( pSubObj ); + if( aName.match(C2U("Handles")) ) + { + m_pMarkObj = pSubObj; + break; + } + } + } + } + return m_pMarkObj; +} + +//virtual +bool SelectionHelper::getMarkHandles( SdrHdlList& rHdlList ) +{ + //@todo -> more flexible handle creation + //2 scenarios possible: + //1. add an additional invisible shape as a child to the selected object + //this child needs to be named somehow and handles need to be generated therefrom ... + //or 2. offer a central service per view where renderer and so can register for handle creation for a special shape + //.. or 3. feature from drawinglayer to create handles for each shape ... (bad performance ... ?) ? + + //scenario 1 is now used: + //if a child with name Handles exsists + //this child is marked instead of the logical selected object + +/* + //if a special mark object was found + //that object should be used for marking only + if( m_pMarkObj != m_pSelectedObj) + return false; +*/ + //if a special mark object was found + //that object should be used to create handles from + if( m_pMarkObj && m_pMarkObj != m_pSelectedObj) + { + rHdlList.Clear(); + if( m_pMarkObj->ISA(SdrPathObj) ) + { + //if th object is a polygon + //from each point a handle is generated + const XPolyPolygon& rPolyPolygon = ((SdrPathObj*)m_pMarkObj)->GetPathPoly(); + for( sal_Int32 nN = 0; nN < rPolyPolygon.Count(); nN++) + { + const XPolygon& rPolygon = rPolyPolygon[nN]; + for( sal_Int32 nM = 0; nM < rPolygon.GetPointCount(); nM++) + { + SdrHdl* pHdl = new SdrHdl(rPolygon[nM],HDL_POLY); + rHdlList.AddHdl(pHdl); + } + } + return true; + } + else + return false; //use the special MarkObject for marking + } + + //@todo: + //add and document good marking defaults ... + + rHdlList.Clear(); + + SdrObject* pObj = m_pSelectedObj; + if(!pObj) + return false; + SdrObjList* pSubList = pObj->GetSubList(); + if( !pSubList )//no group object !pObj->IsGroupObject() + return false; + + SdrObjListIter aIterator(*pSubList, IM_DEEPWITHGROUPS); + + if( pObj->ISA(E3dObject) ) + { + /* + E3dObject* p3DObj = (E3dObject*) pObj; + USHORT nGroup = p3DObj->GetLogicalGroup(); + if(nGroup>0) + aIterator = SdrObjListIter(*((SdrObject*)p3DObj->GetScene()), IM_DEEPWITHGROUPS); + else + */ + return false; + } + + while (aIterator.IsMore()) + { + SdrObject* pSubObj = aIterator.Next(); + Point aPos = pSubObj->GetBoundRect().Center(); + SdrHdl* pHdl = new SdrHdl(aPos,HDL_POLY); + rHdlList.AddHdl(pHdl); + } + return true; +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/controller/main/SelectionHelper.hxx b/chart2/source/controller/main/SelectionHelper.hxx new file mode 100644 index 000000000000..52d4c782c7ee --- /dev/null +++ b/chart2/source/controller/main/SelectionHelper.hxx @@ -0,0 +1,113 @@ +/************************************************************************* + * + * $RCSfile: SelectionHelper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_SELECTIONHELPER_HXX +#define _CHART2_SELECTIONHELPER_HXX + +#include "DrawViewWrapper.hxx" + +class SdrObject; +// header for enum SdrDragMode +#ifndef _SVDTYPES_HXX +#include <svx/svdtypes.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +class SelectionHelper : public MarkHandleProvider +{ +public: + static rtl::OUString getObjectName( SdrObject* pObj ); + static bool findNamedParent( SdrObject*& pInOutObject + , rtl::OUString& rOutName + , bool bGivenObjectMayBeResult ); + static SdrObject* getObjectToSelect( const Point& rMPos + , rtl::OUString& rNameOfLastSelectedObject + , const DrawViewWrapper& rDrawViewWrapper ); + + SelectionHelper( SdrObject* pSelectedObj, const rtl::OUString& rSelectedObjectCID ); + virtual ~SelectionHelper(); + + + //MarkHandleProvider: + virtual bool getMarkHandles( SdrHdlList& rHdlList ); + virtual bool getFrameDragSingles(); + + SdrObject* getObjectToMark();//sets also internally the mark object + //-> getMarkHandles will behave different if this method has found a Mark Object different from m_pSelectedObj + +private: + SdrObject* m_pSelectedObj;//hit and logically selected object + rtl::OUString m_aSelectedObjectCID; + + SdrObject* m_pMarkObj;//object that is marked instead to have more pretty handles +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/controller/main/_serviceregistration_controller.cxx b/chart2/source/controller/main/_serviceregistration_controller.cxx new file mode 100644 index 000000000000..2fc615dc45df --- /dev/null +++ b/chart2/source/controller/main/_serviceregistration_controller.cxx @@ -0,0 +1,116 @@ +/************************************************************************* + * + * $RCSfile: _serviceregistration_controller.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CPPUHELPER_IMPLEMENATIONENTRY_HXX_ +#include <cppuhelper/implementationentry.hxx> +#endif +#ifndef _CHARTCONTROLLER_HXX +#include "ChartController.hxx" +#endif +#ifndef _CHARTFRAMELOADER_HXX +#include "ChartFrameloader.hxx" +#endif + +static struct ::cppu::ImplementationEntry g_entries_chart2_view[] = +{ + { + ::chart::ChartController::create + , ::chart::ChartController::getImplementationName_Static + , ::chart::ChartController::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::ChartFrameLoader::create + , ::chart::ChartFrameLoader::getImplementationName_Static + , ::chart::ChartFrameLoader::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ 0, 0, 0, 0, 0, 0 } +}; + +// component exports +extern "C" +{ +//================================================================================================== +void SAL_CALL component_getImplementationEnvironment( + const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} +//================================================================================================== +sal_Bool SAL_CALL component_writeInfo( + void * pServiceManager, void * pRegistryKey ) +{ + return ::cppu::component_writeInfoHelper( + pServiceManager, pRegistryKey, g_entries_chart2_view ); +} +//================================================================================================== +void * SAL_CALL component_getFactory( + const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) +{ + return ::cppu::component_getFactoryHelper( + pImplName, pServiceManager, pRegistryKey , g_entries_chart2_view ); +} +} +//========================================================================= diff --git a/chart2/source/controller/main/makefile.mk b/chart2/source/controller/main/makefile.mk new file mode 100644 index 000000000000..410dd2f27ed1 --- /dev/null +++ b/chart2/source/controller/main/makefile.mk @@ -0,0 +1,94 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:28 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ= ..$/..$/.. +PRJINC= $(PRJ)$/source +PRJNAME= chart2 +TARGET= chcontroller + +ENABLE_EXCEPTIONS= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: settings.mk + +# --- export library ------------------------------------------------- + +#object files to build and link together to lib $(SLB)$/$(TARGET).lib +SLOFILES = \ + $(SLO)$/ViewSingletons.obj \ + $(SLO)$/ResId.obj \ + $(SLO)$/SelectionHelper.obj \ + $(SLO)$/ChartWindow.obj \ + $(SLO)$/ChartController.obj \ + $(SLO)$/ChartController_Window.obj \ + $(SLO)$/ChartController_Properties.obj \ + $(SLO)$/ChartController_Insert.obj \ + $(SLO)$/ChartFrameloader.obj \ + $(SLO)$/_serviceregistration_controller.obj + +# $(SLO)$/CommonConverters.obj \ +# $(SLO)$/Scaling.obj \ + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk diff --git a/chart2/source/controller/makefile.mk b/chart2/source/controller/makefile.mk new file mode 100644 index 000000000000..656430f14601 --- /dev/null +++ b/chart2/source/controller/makefile.mk @@ -0,0 +1,152 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:24 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ= ..$/.. +PRJNAME= chart2 +TARGET= chartcontroller + +USE_DEFFILE= TRUE +ENABLE_EXCEPTIONS= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: $(PRJ)$/util$/makefile.pmk + +# --- export library ------------------------------------------------- + +#You can use several library macros of this form to build libraries that +#do not consist of all object files in a directory or to merge different libraries. +LIB1TARGET= $(SLB)$/$(TARGET).lib + +LIB1FILES= \ + $(SLB)$/chcontroller.lib \ + $(SLB)$/chcdrawinglayer.lib \ + $(SLB)$/chcitemsetwrapper.lib \ + $(SLB)$/chcdialogs.lib + +#-------- + +#Indicates the filename of the shared library. +SHL1TARGET= $(TARGET)$(UPD)$(DLLPOSTFIX) + +#indicates dependencies: +# .IF "$(COM)" == "MSC" +# SHL1DEPN = \ +# $(SLB)$/charttools.lib \ +# $(SLB)$/chartview.lib +# .ELSE +# SHL1DEPN = +# .ENDIF + +#Specifies an import library to create. For Win32 only. +SHL1IMPLIB= i$(TARGET) + +#Specifies libraries from the same module to put into the shared library. +#was created above +SHL1LIBS= $(LIB1TARGET) + +#Links import libraries. + +SHL1STDLIBS= $(CHARTTOOLS) \ + $(CHARTVIEW) \ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(COMPHELPERLIB) \ + $(GOODIESLIB) \ + $(SALLIB) \ + $(SVLIB) \ + $(SVLLIB) \ + $(SVTOOLLIB) \ + $(SVXLIB) \ + $(TKLIB) \ + $(TOOLSLIB) \ + $(VCLLIB) \ + $(SFXLIB) + +#--------exports + +#specifies the exported symbols for Windows only: +SHL1DEF= $(MISC)$/$(SHL1TARGET).def + +SHL1VERSIONMAP = controller.map + +#--------definition file + +#name of the definition file: +DEF1NAME= $(SHL1TARGET) + +# --- Resources --------------------------------------------------------------- + +RESLIB1LIST=\ + $(SRS)$/chcmenu.srs \ + $(SRS)$/chcdialogs.srs + +RESLIB1NAME= $(TARGET) +RESLIB1SRSFILES=$(RESLIB1LIST) +RESLIB1DEPN=$(RESLIB1LIST) + +#RESLIB1SRSFILES=$(SRS)$/$(TARGET).srs +#RESLIB1DEPN= SRCFILES + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk diff --git a/chart2/source/inc/CachedDataSequence.hxx b/chart2/source/inc/CachedDataSequence.hxx new file mode 100644 index 000000000000..160a782cbb77 --- /dev/null +++ b/chart2/source/inc/CachedDataSequence.hxx @@ -0,0 +1,252 @@ +/************************************************************************* + * + * $RCSfile: CachedDataSequence.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2002 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART_CACHEDDATASEQUENCE_HXX +#define _CHART_CACHEDDATASEQUENCE_HXX + +// helper classes +#ifndef _CPPUHELPER_COMPBASE3_HXX_ +#include <cppuhelper/compbase3.hxx> +#endif +#ifndef _COMPHELPER_UNO3_HXX_ +#include <comphelper/uno3.hxx> +#endif +#ifndef _COMPHELPER_BROADCASTHELPER_HXX_ +#include <comphelper/broadcasthelper.hxx> +#endif +#ifndef _COMPHELPER_PROPERTYCONTAINER_HXX_ +#include <comphelper/propertycontainer.hxx> +#endif +#ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_ +#include <comphelper/proparrhlp.hxx> +#endif +#include "ServiceMacros.hxx" + +// interfaces and types +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif + +// +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XNUMERICALDATASEQUENCE_HPP_ +#include <drafts/com/sun/star/chart2/XNumericalDataSequence.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTEXTUALDATASEQUENCE_HPP_ +#include <drafts/com/sun/star/chart2/XTextualDataSequence.hpp> +#endif + +#include <vector> + +// ____________________ +namespace chart +{ + +namespace impl +{ +typedef ::cppu::WeakComponentImplHelper3< + ::drafts::com::sun::star::chart2::XNumericalDataSequence, + ::drafts::com::sun::star::chart2::XTextualDataSequence, + ::com::sun::star::lang::XServiceInfo > + CachedDataSequence_Base; +} + +class CachedDataSequence : + public ::comphelper::OMutexAndBroadcastHelper, + public ::comphelper::OPropertyContainer, + public ::comphelper::OPropertyArrayUsageHelper< CachedDataSequence >, + public impl::CachedDataSequence_Base +{ +public: + /** constructs an empty sequence + */ + CachedDataSequence(); + + /** creates a sequence and initializes it with the given vector of floating + point numbers + */ + explicit CachedDataSequence( const ::std::vector< double > & rVector ); + + /** creates a sequence and initializes it with the given vector of strings + */ + explicit CachedDataSequence( const ::std::vector< ::rtl::OUString > & rVector ); + + /** creates a sequence and initializes it with the given vector of arbitrary + content + */ + explicit CachedDataSequence( const ::std::vector< ::com::sun::star::uno::Any > & rVector ); + + virtual ~CachedDataSequence(); + + /** optimizes internal storage such that getData() is the fastest method for + retrieving data. + */ + void PreferMixedData(); + /** optimizes internal storage such that getNumericalData() is the fastest + method for retrieving data. + */ + void PreferNumericalData(); + /** optimizes internal storage such that getTextualData() is the fastest + method for retrieving data. + */ + void PreferTextualData(); + + + /// declare XServiceInfo methods + APPHELPER_XSERVICEINFO_DECL() + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +protected: + // ____ XPropertySet ____ + /// @see ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + /// @see ::comphelper::OPropertySetHelper + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + /// @see ::comphelper::OPropertyArrayUsageHelper + virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const; + + // ____ XNumericalDataSequence ____ + /// @see ::drafts::com::sun::star::chart::XNumericalDataSequence + virtual ::com::sun::star::uno::Sequence< double > SAL_CALL getNumericalData() throw (::com::sun::star::uno::RuntimeException); + /// @see ::drafts::com::sun::star::chart::XNumericalDataSequence +// virtual void SAL_CALL setNumericalData( const ::com::sun::star::uno::Sequence< double >& aData ) throw (::com::sun::star::uno::RuntimeException); + + // ____ XTextualDataSequence ____ + /// @see ::drafts::com::sun::star::chart::XTextualDataSequence + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getTextualData() throw (::com::sun::star::uno::RuntimeException); + /// @see ::drafts::com::sun::star::chart::XNumericalDataSequence +// virtual void SAL_CALL setTextualData( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aData ) throw (::com::sun::star::uno::RuntimeException); + + // ____ XDataSequence ____ + /// @see ::drafts::com::sun::star::chart::XDataSequence + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getData() throw (::com::sun::star::uno::RuntimeException); + /// @see ::drafts::com::sun::star::chart::XDataSequence + virtual ::rtl::OUString SAL_CALL getSourceIdentifier() throw (::com::sun::star::uno::RuntimeException); + + mutable ::osl::Mutex m_aMutex; + + // <properties> + sal_Int32 m_nNumberFormatKey; + ::rtl::OUString m_sRole; + // </properties> + + enum DataType + { + NUMERICAL, + TEXTUAL, + MIXED + }; + + /** This method registers all properties. It should be called by all + constructors. + */ + void registerProperties(); + + /** is used by interface method getNumericalData() as well as + PreferNumericalData(). + */ + ::com::sun::star::uno::Sequence< double > Impl_getNumericalData() const; + /** is used by interface method getTextualData() as well as + PreferTextualData(). + */ + ::com::sun::star::uno::Sequence< ::rtl::OUString > Impl_getTextualData() const; + /** is used by interface method getData() as well as PreferMixedData(). + */ + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > Impl_getMixedData() const; + + /** is used by PreferNumericalData(). + */ + void Impl_setNumericalData( const ::com::sun::star::uno::Sequence< double > & rSeq ); + /** is used by PreferTextualData(). + */ + void Impl_setTextualData( const ::com::sun::star::uno::Sequence< ::rtl::OUString > & rSeq ); + /** is used by PreferMixedData(). + */ + void Impl_setMixedData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > & rSeq ); + +private: + ::rtl::OUString m_sSourceIdentifier; + + enum DataType m_eCurrentDataType; + + ::com::sun::star::uno::Sequence< double > m_aNumericalSequence; + ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aTextualSequence; + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Any > m_aMixedSequence; + + sal_Bool m_bIsHidden; + ::com::sun::star::uno::Sequence< sal_Int32 > m_aHiddenValues; +}; + +} // namespace chart + + +// _CHART_CACHEDDATASEQUENCE_HXX +#endif diff --git a/chart2/source/inc/ChartModelHelper.hxx b/chart2/source/inc/ChartModelHelper.hxx new file mode 100644 index 000000000000..81d908b44e74 --- /dev/null +++ b/chart2/source/inc/ChartModelHelper.hxx @@ -0,0 +1,112 @@ +/************************************************************************* + * + * $RCSfile: ChartModelHelper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_CONTROLLER_CHARTMODELHELPER_HXX +#define _CHART2_CONTROLLER_CHARTMODELHELPER_HXX + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDATASERIES_HPP_ +#include <drafts/com/sun/star/chart2/XDataSeries.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDIAGRAM_HPP_ +#include <drafts/com/sun/star/chart2/XDiagram.hpp> +#endif + +#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_ +#include <com/sun/star/frame/XModel.hpp> +#endif + +#include <vector> + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +class ChartModelHelper +{ +public: + static ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDiagram > + findDiagram( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel ); + + static sal_Int32 getDimensionAndFirstChartType( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDiagram >& xDiagram, rtl::OUString& rChartType ); + + static ::std::vector< ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeries > > getDataSeries( + const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > & xModel ); + + static ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeries > + getSeriesByIdentifier( + const rtl::OUString& rIdentifier + , const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > xModel ); +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/inc/CommonConverters.hxx b/chart2/source/inc/CommonConverters.hxx new file mode 100644 index 000000000000..96921e39cb5c --- /dev/null +++ b/chart2/source/inc/CommonConverters.hxx @@ -0,0 +1,266 @@ +/************************************************************************* + * + * $RCSfile: CommonConverters.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef __CHART_COMMON_CONVERTERS_HXX +#define __CHART_COMMON_CONVERTERS_HXX + +#ifndef _SVX_VECTOR3D_HXX +#include <goodies/vector3d.hxx> +#endif +#ifndef _B3D_HMATRIX_HXX +#include <goodies/hmatrix.hxx> +#endif +#ifndef _B2D_MATRIX3D_HXX +#include <goodies/matrix3d.hxx> +#endif +#ifndef _TL_POLY_HXX +#include <tools/poly.hxx> +#endif + +#ifndef _COM_SUN_STAR_DRAWING_DIRECTION3D_HPP_ +#include <com/sun/star/drawing/Direction3D.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_HOMOGENMATRIX_HPP_ +#include <com/sun/star/drawing/HomogenMatrix.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_HOMOGENMATRIX3_HPP_ +#include <com/sun/star/drawing/HomogenMatrix3.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_POINTSEQUENCESEQUENCE_HPP_ +#include <com/sun/star/drawing/PointSequenceSequence.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_POSITION3D_HPP_ +#include <com/sun/star/drawing/Position3D.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_POLYPOLYGONSHAPE3D_HPP_ +#include <com/sun/star/drawing/PolyPolygonShape3D.hpp> +#endif +#ifndef _COM_SUN_STAR_TEXT_WRITINGMODE_HPP_ +#include <com/sun/star/text/WritingMode.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +diverse methods for class conversions; e.g. Matrix4D to HomogenMatrix +and operations e.g drawing::Position3D + drawing::Direction3D +*/ + +//----------------------------------------------------------------------------- +/** Matrix4D -> HomogenMatrix +*/ +com::sun::star::drawing::HomogenMatrix + Matrix4DToHomogenMatrix( const Matrix4D& rM4 ); + +//----------------------------------------------------------------------------- +/** HomogenMatrix -> Matrix4D +*/ +Matrix4D HomogenMatrixToMatrix4D( const com::sun::star::drawing::HomogenMatrix& rHM ); + +//----------------------------------------------------------------------------- +/** Matrix4D -> Matrix3D +*/ +Matrix3D IgnoreZ( const Matrix4D& rM4 ); + +//----------------------------------------------------------------------------- +/** Matrix3D <-> HomogenMatrix3 +*/ +com::sun::star::drawing::HomogenMatrix3 + Matrix3DToHomogenMatrix3( const Matrix3D& rM3 ); + +Matrix3D HomogenMatrix3ToMatrix3D( const com::sun::star::drawing::HomogenMatrix3& rHM ); + +//----------------------------------------------------------------------------- +/** Position3D -> Vector3D +*/ +Vector3D Position3DToVector3D( const com::sun::star::drawing::Position3D& rPosition ); + +//----------------------------------------------------------------------------- +/** Vector3D -> Direction3D +*/ +com::sun::star::drawing::Direction3D + Vector3DToDirection3D( const Vector3D& rVector); + +//----------------------------------------------------------------------------- +/** two drawing::Position3D -> PolyPolygonShape3D +*/ +::com::sun::star::drawing::PolyPolygonShape3D + MakeLine3D( const ::com::sun::star::drawing::Position3D & rStart, + const ::com::sun::star::drawing::Position3D & rEnd ); + +//----------------------------------------------------------------------------- +/** PolyPolygonShape3D + drawing::Position3D -> PolyPolygonShape3D +*/ +void AddPointToPoly( com::sun::star::drawing::PolyPolygonShape3D& rPoly + , const com::sun::star::drawing::Position3D& rPos + , sal_Int32 nSequenceIndex=0 ); + +//----------------------------------------------------------------------------- +/** PolyPolygonShape3D + PolyPolygonShape3D -> PolyPolygonShape3D +*/ +void appendPoly( com::sun::star::drawing::PolyPolygonShape3D& rRet + , const com::sun::star::drawing::PolyPolygonShape3D& rAdd ); + +//----------------------------------------------------------------------------- +/** PolyPolygonShape3D -> drawing::PointSequenceSequence (2D) +*/ +com::sun::star::drawing::PointSequenceSequence PolyToPointSequence( + const com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygon ); + +//----------------------------------------------------------------------------- +/** PolyPolygonShape3D -> Polygon (2D,integer!) +*/ +Polygon PolyToToolsPoly( + const com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygon ); + +//----------------------------------------------------------------------------- +/** tools Polygon (2D,integer!) -> PolyPolygonShape3D +*/ +com::sun::star::drawing::PolyPolygonShape3D ToolsPolyToPoly( + const Polygon& rToolsPoly, double zValue ); + + +//----------------------------------------------------------------------------- +/** Position3D + Direction3D == Position3D +*/ +com::sun::star::drawing::Position3D + operator+( const com::sun::star::drawing::Position3D& rPos + , const com::sun::star::drawing::Direction3D& rDirection); + +//----------------------------------------------------------------------------- +/** Position3D - Direction3D == Position3D +*/ +com::sun::star::drawing::Position3D + operator-( const com::sun::star::drawing::Position3D& rPos + , const com::sun::star::drawing::Direction3D& rDirection); + + +//----------------------------------------------------------------------------- +/** Position3D - Position3D == Direction3D +*/ +com::sun::star::drawing::Direction3D + operator-( const com::sun::star::drawing::Position3D& rPos1 + , const com::sun::star::drawing::Position3D& rPos2); + +//----------------------------------------------------------------------------- +/** Direction3D * double == Direction3D +*/ +com::sun::star::drawing::Direction3D + operator*( const com::sun::star::drawing::Direction3D& rDirection + , double fFraction); + +//----------------------------------------------------------------------------- +/** Sequence<double> -> Vector3D +*/ +Vector3D SequenceToVector3D( const com::sun::star::uno::Sequence< double >& rSeq ); + +//----------------------------------------------------------------------------- +/** Vector3D -> Sequence<double> +*/ +com::sun::star::uno::Sequence< double > + Vector3DToSequence( const Vector3D& rVector ); + +//----------------------------------------------------------------------------- +/** Sequence<double> -> drawing::Position3D +*/ +com::sun::star::drawing::Position3D + SequenceToPosition3D( const com::sun::star::uno::Sequence< double >& rSeq ); + +//----------------------------------------------------------------------------- +/** drawing::Position3D -> Sequence<double> +*/ + +com::sun::star::uno::Sequence< double > + Position3DToSequence( const com::sun::star::drawing::Position3D& rPosition ); + +//----------------------------------------------------------------------------- +/** Sequence<double> -> drawing::Direction3D +*/ +com::sun::star::drawing::Direction3D + SequenceToDirection3D( const com::sun::star::uno::Sequence< double >& rSeq ); + +//----------------------------------------------------------------------------- +/** drawing::Direction3D -> Sequence<double> +*/ + +com::sun::star::uno::Sequence< double > + Direction3DToSequence( const com::sun::star::drawing::Direction3D& rDirection ); + +//----------------------------------------------------------------------------- +/** drawing::Direction3D / double +*/ + +com::sun::star::drawing::Direction3D + operator/( const com::sun::star::drawing::Direction3D& rDirection, double f ); + +//----------------------------------------------------------------------------- +/** text::WritingMode2 -> text::WritingMode +*/ + +com::sun::star::text::WritingMode WritingMode2ToWritingMode1( sal_Int16 nWritingMode ); + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/inc/ContextHelper.hxx b/chart2/source/inc/ContextHelper.hxx new file mode 100644 index 000000000000..a3812f0863fd --- /dev/null +++ b/chart2/source/inc/ContextHelper.hxx @@ -0,0 +1,99 @@ +/************************************************************************* + * + * $RCSfile: ContextHelper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_CONTEXTHELPER_HXX +#define CHART_CONTEXTHELPER_HXX + +#include "InlineContainer.hxx" + +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/uno/Any.hxx> +#include <rtl/ustring.hxx> + +#include <map> + +namespace chart +{ + +namespace ContextHelper +{ + +typedef ::std::map< ::rtl::OUString, ::com::sun::star::uno::Any > + tContextEntryMapType; +typedef ::comphelper::MakeMap< ::rtl::OUString, ::com::sun::star::uno::Any > + MakeContextEntryMap; + +/** creates a component context containing the properties given in the map. + + @param rDelegateContext + delegation to further context + */ +::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + createContext( const tContextEntryMapType & rMap, + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > & rDelegateContext = + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >() ); + +} // namespace ContextHelper + +} // namespace chart + +// CHART_CONTEXTHELPER_HXX +#endif diff --git a/chart2/source/inc/LegendHelper.hxx b/chart2/source/inc/LegendHelper.hxx new file mode 100644 index 000000000000..cf9c1a5c0625 --- /dev/null +++ b/chart2/source/inc/LegendHelper.hxx @@ -0,0 +1,87 @@ +/************************************************************************* + * + * $RCSfile: LegendHelper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_TOOLS_LEGENDHELPER_HXX +#define _CHART2_TOOLS_LEGENDHELPER_HXX + +// header for class OUString +#ifndef _RTL_USTRING_HXX_ +#include <rtl/ustring.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +class LegendHelper +{ +public: + static rtl::OUString getIdentifierForLegend(); +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/inc/LifeTime.hxx b/chart2/source/inc/LifeTime.hxx new file mode 100644 index 000000000000..7717d08422ce --- /dev/null +++ b/chart2/source/inc/LifeTime.hxx @@ -0,0 +1,301 @@ +/************************************************************************* + * + * $RCSfile: LifeTime.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _LIFETIME_HXX +#define _LIFETIME_HXX + +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif +#ifndef _OSL_CONDITN_HXX_ +#include <osl/conditn.hxx> +#endif +#ifndef _COM_SUN_STAR_UNO_EXCEPTION_HDL_ +#include <com/sun/star/uno/Exception.hdl> +#endif +#ifndef _CPPUHELPER_INTERFACECONTAINER_HXX_ +#include <cppuhelper/interfacecontainer.hxx> +#endif +#ifndef _COM_SUN_STAR_UTIL_XCLOSELISTENER_HPP_ +#include <com/sun/star/util/XCloseListener.hpp> +#endif +#ifndef _COM_SUN_STAR_UTIL_XCLOSEABLE_HPP_ +#include <com/sun/star/util/XCloseable.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_ +#include <com/sun/star/lang/XComponent.hpp> +#endif +#ifndef _CPPUHELPER_WEAKREF_HXX_ +#include <cppuhelper/weakref.hxx> +#endif + +namespace apphelper +{ + +class LifeTimeGuard; +class LifeTimeManager +{ +friend class LifeTimeGuard; +public: + LifeTimeManager( ::com::sun::star::lang::XComponent* pComponent, sal_Bool bLongLastingCallsCancelable = sal_False ); + virtual ~LifeTimeManager(); + + sal_Bool impl_isDisposed(); + sal_Bool dispose() throw(::com::sun::star::uno::RuntimeException); + +public: + ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; + +protected: + virtual sal_Bool impl_canStartApiCall(); + virtual void impl_apiCallCountReachedNull(){}; + + void impl_registerApiCall(sal_Bool bLongLastingCall); + void impl_unregisterApiCall(sal_Bool bLongLastingCall); + + void impl_init(); + +protected: + mutable ::osl::Mutex m_aAccessMutex; + + ::com::sun::star::lang::XComponent* m_pComponent; + + ::osl::Condition m_aNoAccessCountCondition; + sal_Int32 volatile m_nAccessCount; + + sal_Bool volatile m_bDisposed; + sal_Bool volatile m_bInDispose; + + // + sal_Bool m_bLongLastingCallsCancelable; + ::osl::Condition m_aNoLongLastingCallCountCondition; + sal_Int32 volatile m_nLongLastingCallCount; +}; + +class CloseableLifeTimeManager : public LifeTimeManager +{ +protected: + ::com::sun::star::util::XCloseable* m_pCloseable; + + ::osl::Condition m_aEndTryClosingCondition; + sal_Bool volatile m_bClosed; + sal_Bool volatile m_bInTryClose; + //the ownership between model and controller is not clear at first + //each controller might consider him as owner of the model first + //at start the model is not considered as owner of itself + sal_Bool volatile m_bOwnership; + //with a XCloseable::close call and during XCloseListener::queryClosing + //the ownership can be regulated more explicit, + //if so the ownership is considered to be well known + sal_Bool volatile m_bOwnershipIsWellKnown; + +public: + CloseableLifeTimeManager( ::com::sun::star::util::XCloseable* pCloseable + , ::com::sun::star::lang::XComponent* pComponent + , sal_Bool bLongLastingCallsCancelable = sal_False ); + virtual ~CloseableLifeTimeManager(); + + sal_Bool impl_isDisposedOrClosed(); + sal_Bool g_close_startTryClose(sal_Bool bDeliverOwnership) + throw ( ::com::sun::star::uno::Exception ); + sal_Bool g_close_isNeedToCancelLongLastingCalls( sal_Bool bDeliverOwnership, ::com::sun::star::uno::Exception& ex ) + throw ( ::com::sun::star::uno::Exception ); + void g_close_endTryClose(sal_Bool bDeliverOwnership, sal_Bool bMyVeto, ::com::sun::star::uno::Exception& ex) + throw ( ::com::sun::star::uno::Exception ); + void g_close_endTryClose_doClose(); + sal_Bool g_addCloseListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::util::XCloseListener > & xListener ) + throw(::com::sun::star::uno::RuntimeException); + +protected: + virtual sal_Bool impl_canStartApiCall(); + virtual void impl_apiCallCountReachedNull(); + + void impl_setOwnership( sal_Bool bDeliverOwnership, sal_Bool bMyVeto ); + sal_Bool impl_shouldCloseAtNextChance(); + void impl_doClose(); + + void impl_init() + { + m_bClosed = sal_False; + m_bInTryClose = sal_False; + m_bOwnership = sal_False; + m_bOwnershipIsWellKnown = sal_False; + m_aEndTryClosingCondition.set(); + } +}; + +//----------------------------------------------------------------- +/* +Use this Guard in your apicalls to protect access on resources +which will be released in dispose. +It's guarantied, that the release of resources only starts if your +guarded call has finished. +! It's only partly guaranteed that this resources will not change during the call. +See the example for details. + +This class is to be used as described in the example. + +If this guard is used in all api calls of an XCloseable object +it's guarantied, that the closeable will close itself after finishing the last call +if it should do so. + + ::ApiCall +{ + //hold no mutex!!! + LifeTimeGuard aLifeTimeGuard(m_aLifeTimeManager); + + //mutex is acquired; call is not registered + + if(!aGuard.startApiCall()) + return ; //behave as passive as possible, if disposed or closed + + //mutex is acquired, call is registered + { + //you might access some private members here + //but than you need to protect access to these members always like this + //never call to the outside here + } + + aLifeTimeGuard.clear(); //!!! + + //Mutex is released, the running call is still registered + //this call will finish before the 'release-section' in dispose is allowed to start + + { + //you might access some private members here guarded with your own mutex + //but release your mutex at the end of this block + } + + //you can call to the outside (without holding the mutex) without becoming disposed + + //End of method -> ~LifeTimeGuard + //-> call is unregistered + //-> this object might be disposed now +} + +your XComponent::dispose method has to be implemented in the following way: + + ::dispose() +{ + //hold no mutex!!! + if( !m_aLifeTimeManager.dispose() ) + return; + + //--release all resources and references + //... +} + +*/ +//----------------------------------------------------------------- + +class LifeTimeGuard : public ::osl::ResettableMutexGuard +{ + +public: + LifeTimeGuard( LifeTimeManager& rManager ) + : ::osl::ResettableGuard< ::osl::Mutex >( rManager.m_aAccessMutex ) + , m_rManager(rManager) + , m_bCallRegistered(sal_False) + , m_bLongLastingCallRegistered(sal_False) + { + + } + sal_Bool startApiCall(sal_Bool bLongLastingCall=sal_False); + virtual ~LifeTimeGuard(); + +private: + LifeTimeManager& m_rManager; + sal_Bool m_bCallRegistered; + sal_Bool m_bLongLastingCallRegistered; + +private: + // these make no sense + LifeTimeGuard( ::osl::Mutex& rMutex ); + LifeTimeGuard( const LifeTimeGuard& ); + LifeTimeGuard& operator= ( const LifeTimeGuard& ); +}; + + +template<class T> +class NegativeGuard +{ +protected: + T * m_pT; +public: + + NegativeGuard(T * pT) : m_pT(pT) + { + m_pT->release(); + } + + NegativeGuard(T & t) : m_pT(&t) + { + m_pT->release(); + } + + ~NegativeGuard() + { + m_pT->acquire(); + } +}; + +}//end namespace apphelper +#endif diff --git a/chart2/source/inc/MediaDescriptorHelper.hxx b/chart2/source/inc/MediaDescriptorHelper.hxx new file mode 100644 index 000000000000..cd2de58ea639 --- /dev/null +++ b/chart2/source/inc/MediaDescriptorHelper.hxx @@ -0,0 +1,225 @@ +/************************************************************************* + * + * $RCSfile: MediaDescriptorHelper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _MEDIADESCRIPTORHELPER_HXX +#define _MEDIADESCRIPTORHELPER_HXX + +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ +#include <com/sun/star/uno/Sequence.hxx> +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ +#include <com/sun/star/beans/PropertyValue.hpp> +#endif +#ifndef _COM_SUN_STAR_UTIL_URL_HPP_ +#include <com/sun/star/util/URL.hpp> +#endif +#ifndef _COM_SUN_STAR_AWT_RECTANGLE_HPP_ +#include <com/sun/star/awt/Rectangle.hpp> +#endif + +/* +* This class helps to read and write the properties mentioned in the service description +* com.sun.star.document.MediaDescriptor from and to a sequence of PropertyValues. +* Properties that are not mentioned in the service description +* are stored in the member AdditionalProperties. +* +* As an additional feature this helper class can generate a reduced sequence of PropertyValues +* that does not contain properties which are known to be only view relevant. This +* reduced sequence than might be attached to a model directly. +*/ + +namespace apphelper +{ + +class MediaDescriptorHelper +{ +private: + //MediaDescriptorHelper(){}; +public: + MediaDescriptorHelper( const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > & rMediaDescriptor ); + virtual ~MediaDescriptorHelper(); + + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > getAll(); + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > getReducedForModel(); + +public: + //--------------------- + //all properties given in the constructor are stored in the following three sequences + + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > + m_aRegularProperties; //these are the properties which are described in service com.sun.star.document.MediaDescriptor and not marked as deprecated + + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > + m_aDeprecatedProperties; //these are properties which are described in service com.sun.star.document.MediaDescriptor but are marked as deprecated + + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > + m_aAdditionalProperties; //these are properties which are not described in service com.sun.star.document.MediaDescriptor + + //---------------------- + //properties which should be given to a model are additionally stored in this sequence (not documented properties and deprecated properties are not included!) + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > + m_aModelProperties; //these are properties which are not described in service com.sun.star.document.MediaDescriptor + + + //@todo define this for debug only, except URL + sal_Bool AsTemplate; //document is a template. + sal_Bool ISSET_AsTemplate; + ::rtl::OUString Author; // + sal_Bool ISSET_Author; + ::rtl::OUString CharacterSet; //identifier of used character set. + sal_Bool ISSET_CharacterSet; + ::rtl::OUString Comment;// + sal_Bool ISSET_Comment; + + ::com::sun::star::uno::Any + ComponentData;// + sal_Bool ISSET_ComponentData; + ::rtl::OUString FileName; //deprecated, same as url + sal_Bool ISSET_FileName; + ::com::sun::star::uno::Any + FilterData;// + sal_Bool ISSET_FilterData; + ::rtl::OUString FilterName; //internal filter name. + sal_Bool ISSET_FilterName; + ::rtl::OUString FilterFlags;//deprecated, + sal_Bool ISSET_FilterFlags; + ::rtl::OUString FilterOptions;// + sal_Bool ISSET_FilterOptions; + //not documented ... @todo remove? + ::rtl::OUString FrameName; //name of target frame. + sal_Bool ISSET_FrameName; + sal_Bool Hidden; //load document, invisible. + sal_Bool ISSET_Hidden; + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + InputStream; //content of document. //::com::sun::star::io::XInputStream + sal_Bool ISSET_InputStream; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + InteractionHandler; // //::com::sun::star::task::XInteractionHandler + sal_Bool ISSET_InteractionHandler; + + ::rtl::OUString JumpMark; //specifies the name of a mark within the document where the first view is to position itself. + sal_Bool ISSET_JumpMark; + ::rtl::OUString MediaType; //mime type. + sal_Bool ISSET_MediaType; + ::rtl::OUString OpenFlags; //deprecated + sal_Bool ISSET_OpenFlags; + sal_Bool OpenNewView; //opens a new view for an already loaded document. + sal_Bool ISSET_OpenNewView; + sal_Bool Overwrite; //opens a new view for an already loaded document. + sal_Bool ISSET_Overwrite; + ::rtl::OUString Password; // + sal_Bool ISSET_Password; + + //not documented ... @todo remove? + ::com::sun::star::awt::Rectangle + PosSize; //position and size of document window. + sal_Bool ISSET_PosSize; + + ::com::sun::star::uno::Sequence< sal_Int8 > + PostData; //contains the data for HTTP post method as a sequence of bytes. + sal_Bool ISSET_PostData; + ::rtl::OUString PostString; //deprecated, contains the data for HTTP post method as a sequence of bytes. + sal_Bool ISSET_PostString; + sal_Bool Preview; //show preview. + sal_Bool ISSET_Preview; + sal_Bool ReadOnly; //open document readonly. + sal_Bool ISSET_ReadOnly; + ::rtl::OUString Referer; //name of document referrer. + sal_Bool ISSET_Referer; + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + StatusIndicator; // //::com::sun::star::task::XStatusIndicator + sal_Bool ISSET_StatusIndicator; + //not documented ... @todo remove? + sal_Bool Silent; //prevents dialogs to query for more information. + sal_Bool ISSET_Silent; + ::rtl::OUString TemplateName; //deprecated, name of the template instead of the URL. + sal_Bool ISSET_TemplateName; + ::rtl::OUString TemplateRegionName; //deprecated, name of the region of the template. + sal_Bool ISSET_TemplateRegionName; + sal_Bool Unpacked; + sal_Bool ISSET_Unpacked; + ::com::sun::star::util::URL + URL;// FileName, URL of the document. + sal_Bool ISSET_URL; + sal_Int16 Version; //storage version. + sal_Bool ISSET_Version; + + ::com::sun::star::uno::Any + ViewData;// + sal_Bool ISSET_ViewData; + sal_Int16 ViewId; //id of the initial view. + sal_Bool ISSET_ViewId; + +protected: + void impl_init(); +}; + +} + +#endif diff --git a/chart2/source/inc/MutexContainer.hxx b/chart2/source/inc/MutexContainer.hxx new file mode 100644 index 000000000000..105b7cff82f1 --- /dev/null +++ b/chart2/source/inc/MutexContainer.hxx @@ -0,0 +1,88 @@ +/************************************************************************* + * + * $RCSfile: MutexContainer.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_MUTEXCONTAINER_HXX +#define CHART_MUTEXCONTAINER_HXX + +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif + +namespace chart +{ +namespace helper +{ + +class MutexContainer +{ +public: + virtual ~MutexContainer(); + +protected: + mutable ::osl::Mutex m_aMutex; + + virtual ::osl::Mutex & GetMutex() const; +}; + +} // namespace helper +} // namespace chart + +// CHART_MUTEXCONTAINER_HXX +#endif diff --git a/chart2/source/inc/OEnumeration.hxx b/chart2/source/inc/OEnumeration.hxx new file mode 100644 index 000000000000..60adfb673056 --- /dev/null +++ b/chart2/source/inc/OEnumeration.hxx @@ -0,0 +1,101 @@ +/************************************************************************* + * + * $RCSfile: OEnumeration.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_OENUMERATION_HXX +#define CHART_OENUMERATION_HXX + +#ifndef _CPPUHELPER_IMPLBASE1_HXX_ +#include <cppuhelper/implbase1.hxx> +#endif +#ifndef _COM_SUN_STAR_CONTAINER_XENUMERATION_HPP_ +#include <com/sun/star/container/XEnumeration.hpp> +#endif + +#include <vector> + +namespace comphelper +{ + +class OEnumeration : + public ::cppu::WeakImplHelper1< + ::com::sun::star::container::XEnumeration > +{ +public: + OEnumeration( const ::std::vector< ::com::sun::star::uno::Any > & rContainer ); + virtual ~OEnumeration(); + +protected: + // ____ XEnumeration ____ + virtual sal_Bool SAL_CALL hasMoreElements() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL nextElement() + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + +private: + ::std::vector< ::com::sun::star::uno::Any > m_aContainer; + ::std::vector< ::com::sun::star::uno::Any >::const_iterator m_aIter; +}; + +} // namespace comphelper + +// CHART_OENUMERATION_HXX +#endif diff --git a/chart2/source/inc/OIndexContainer.hxx b/chart2/source/inc/OIndexContainer.hxx new file mode 100644 index 000000000000..6171839c99e3 --- /dev/null +++ b/chart2/source/inc/OIndexContainer.hxx @@ -0,0 +1,152 @@ +/************************************************************************* + * + * $RCSfile: OIndexContainer.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_OINDEXCONTAINER_HXX +#define CHART_OINDEXCONTAINER_HXX + +#ifndef _CPPUHELPER_IMPLBASE1_HXX_ +#include <cppuhelper/implbase1.hxx> +#endif +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif + +#ifndef _COM_SUN_STAR_CONTAINER_XINDEXCONTAINER_HPP_ +#include <com/sun/star/container/XIndexContainer.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_ +#include <com/sun/star/lang/XTypeProvider.hpp> +#endif + +#include <vector> + +namespace comphelper +{ + +class OIndexContainer : + public ::com::sun::star::container::XIndexContainer +{ +public: + explicit OIndexContainer( ::osl::Mutex & rMutex ); + virtual ~OIndexContainer(); + + ::osl::Mutex & GetMutex(); + + // ____ XInterface ____ + virtual ::com::sun::star::uno::Any SAL_CALL + queryInterface( const ::com::sun::star::uno::Type& aType ) + throw (::com::sun::star::uno::RuntimeException); + +protected: + /// implemented as a standard-library vector + typedef ::std::vector< ::com::sun::star::uno::Any > tHelperContainerType; + + /// allows direct standard-library access to the container + tHelperContainerType m_aContainer; + + // you have to implement this in derived classes + // ____ XElementAccess ____ +// virtual ::com::sun::star::uno::Type SAL_CALL getElementType() +// throw (::com::sun::star::uno::RuntimeException) = 0; + + // implemented by this class + // ========================= + + // ____ XIndexContainer ____ + virtual void SAL_CALL insertByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeByIndex( sal_Int32 Index ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // ____ XIndexReplace ____ + virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // ____ XIndexAccess ____ + virtual sal_Int32 SAL_CALL getCount() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // ____ XElementAccess ____ + virtual sal_Bool SAL_CALL hasElements() + throw (::com::sun::star::uno::RuntimeException); + +private: + ::osl::Mutex & m_rMutex; +}; + +} // namespace comphelper + +// CHART_OINDEXCONTAINER_HXX +#endif diff --git a/chart2/source/inc/OPropertySet.hxx b/chart2/source/inc/OPropertySet.hxx new file mode 100644 index 000000000000..ce271c2edb9b --- /dev/null +++ b/chart2/source/inc/OPropertySet.hxx @@ -0,0 +1,346 @@ +/************************************************************************* + * + * $RCSfile: OPropertySet.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_OPROPERTYSET_HXX +#define CHART_OPROPERTYSET_HXX + +// helper classes +#ifndef _CPPUHELPER_PROPSHLP_HXX +#include <cppuhelper/propshlp.hxx> +#endif +#ifndef _CPPUHELPER_INTERFACECONTAINER_HXX_ +#include <cppuhelper/interfacecontainer.hxx> +#endif +#ifndef _CPPUHELPER_WEAK_HXX_ +#include <cppuhelper/weak.hxx> +#endif + +// interfaces and types +// #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +// #include <com/sun/star/lang/XServiceInfo.hpp> +// #endif +#ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_ +#include <com/sun/star/lang/XTypeProvider.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_ +#include <com/sun/star/beans/XPropertyState.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XMULTIPROPERTYSTATES_HPP_ +#include <com/sun/star/beans/XMultiPropertyStates.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTY_HPP_ +#include <com/sun/star/beans/Property.hpp> +#endif + +#ifndef _DRAFTS_COM_SUN_STAR_STYLE_XSTYLESUPPLIER_HPP_ +#include <drafts/com/sun/star/style/XStyleSupplier.hpp> +#endif +// #ifndef _DRAFTS_COM_SUN_STAR_BEANS_XFASTPROPERTYSTATE_HPP_ +// #include <drafts/com/sun/star/beans/XFastPropertyState.hpp> +// #endif + +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif + +#include <memory> + +namespace property +{ + +namespace impl +{ class ImplOPropertySet; } + + +class OPropertySet : + public ::cppu::OBroadcastHelper, + // includes beans::XPropertySet, XMultiPropertySet and XFastPropertySet + public ::cppu::OPropertySetHelper, + // includes uno::XWeak (and XInterface, esp. ref-counting) +// public virtual ::cppu::OWeakObject, + +// public virtual ::com::sun::star::lang::XServiceInfo, + public ::com::sun::star::lang::XTypeProvider, + public ::com::sun::star::beans::XPropertyState, + public ::com::sun::star::beans::XMultiPropertyStates, + public ::drafts::com::sun::star::style::XStyleSupplier +// public ::drafts::com::sun::star::beans::XFastPropertyState +{ +public: + OPropertySet( ::osl::Mutex & rMutex ); + virtual ~OPropertySet(); + +protected: + /** implement this method to provide default values for all properties + supporting defaults. If a property does not have a default value, you + may throw an UnknownPropertyException. + */ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException) = 0; + + /** The InfoHelper table contains all property names and types of + this object. + + @return the object that provides information for the + PropertySetInfo + + @see ::cppu::OPropertySetHelper + */ + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() = 0; + + // ____ XPropertySet ____ + /** sample implementation using the InfoHelper: + + <pre> + uno::Reference< beans::XPropertySetInfo > SAL_CALL + OPropertySet::getPropertySetInfo() + throw (uno::RuntimeException) + { + static uno::Reference< beans::XPropertySetInfo > xInfo; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- + } + </pre> + + <p>(The reason why this isn't implemented here is, that the static + object is only valid per concrete PropertySet. Otherwise all + PropertySets derived from this base calss would have the same + properties.)</p> + + @see ::cppu::OPropertySetHelper + */ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException) = 0; + + /** Try to convert the value <code>rValue</code> to the type required by the + property associated with <code>nHandle</code>. + + Overload this method to take influence in modification of properties. + + If the conversion changed , </TRUE> is returned and the converted value + is in <code>rConvertedValue</code>. The former value is contained in + <code>rOldValue</code>. + + After this call returns successfully, the vetoable listeners are + notified. + + @throws IllegalArgumentException, if the conversion was not successful, + or if there is no corresponding property to the given handle. + + @param rConvertedValue the converted value. Only set if return is true. + @param rOldValue the old value. Only set if return is true. + @param nHandle the handle of the property. + + @return true, if the conversion was successful and converted value + differs from the old value. + + @see ::cppu::OPropertySetHelper + */ + virtual sal_Bool SAL_CALL convertFastPropertyValue + ( ::com::sun::star::uno::Any & rConvertedValue, + ::com::sun::star::uno::Any & rOldValue, + sal_Int32 nHandle, + const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); + + /** The same as setFastProperyValue; nHandle is always valid. + The changes must not be broadcasted in this method. + + @attention + Although you are permitted to throw any UNO exception, only the following + are valid for usage: + -- ::com::sun::star::beans::UnknownPropertyException + -- ::com::sun::star::beans::PropertyVetoException + -- ::com::sun::star::lang::IllegalArgumentException + -- ::com::sun::star::lang::WrappedTargetException + -- ::com::sun::star::uno::RuntimeException + + @param nHandle handle + @param rValue value + + @see ::cppu::OPropertySetHelper + */ + virtual void SAL_CALL setFastPropertyValue_NoBroadcast + ( sal_Int32 nHandle, + const ::com::sun::star::uno::Any& rValue ) + throw (::com::sun::star::uno::Exception); + + /** + The same as getFastProperyValue, but return the value through rValue and + nHandle is always valid. + + @see ::cppu::OPropertySetHelper + */ + virtual void SAL_CALL getFastPropertyValue + ( ::com::sun::star::uno::Any& rValue, + sal_Int32 nHandle ) const; + + /// make original interface function visible again + using ::com::sun::star::beans::XFastPropertySet::getFastPropertyValue; + + // ======================================== + // Interfaces + // ======================================== + + // ____ XInterface ____ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) + throw (::com::sun::star::uno::RuntimeException); +// virtual void SAL_CALL acquire() throw (); +// virtual void SAL_CALL release() throw (); + + + // ____ XServiceInfo ____ +// virtual ::rtl::OUString SAL_CALL +// getImplementationName() +// throw (::com::sun::star::uno::RuntimeException); +// virtual sal_Bool SAL_CALL +// supportsService( const ::rtl::OUString& ServiceName ) +// throw (::com::sun::star::uno::RuntimeException); +// virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL +// getSupportedServiceNames() +// throw (::com::sun::star::uno::RuntimeException); + + // ____ XTypeProvider ____ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL + getTypes() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL + getImplementationId() + throw (::com::sun::star::uno::RuntimeException); + + // ____ XPropertyState ____ + virtual ::com::sun::star::beans::PropertyState SAL_CALL + getPropertyState( const ::rtl::OUString& PropertyName ) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL + getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + setPropertyToDefault( const ::rtl::OUString& PropertyName ) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL + getPropertyDefault( const ::rtl::OUString& aPropertyName ) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // ____ XMultiPropertyStates ____ + // Note: getPropertyStates() is already implemented in XPropertyState with the + // same signature + virtual void SAL_CALL + setAllPropertiesToDefault() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL + getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // ____ XStyleSupplier ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle > SAL_CALL getStyle() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setStyle( const ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >& xStyle ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // ____ XFastPropertyState ____ +// virtual ::com::sun::star::beans::PropertyState SAL_CALL getFastPropertyState( sal_Int32 nHandle ) +// throw (::com::sun::star::beans::UnknownPropertyException, +// ::com::sun::star::uno::RuntimeException); +// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getFastPropertyStates( const ::com::sun::star::uno::Sequence< sal_Int32 >& aHandles ) +// throw (::com::sun::star::beans::UnknownPropertyException, +// ::com::sun::star::uno::RuntimeException); +// virtual void SAL_CALL setFastPropertyToDefault( sal_Int32 nHandle ) +// throw (::com::sun::star::beans::UnknownPropertyException, +// ::com::sun::star::uno::RuntimeException); +// virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyDefault( sal_Int32 nHandle ) +// throw (::com::sun::star::beans::UnknownPropertyException, +// ::com::sun::star::lang::WrappedTargetException, +// ::com::sun::star::uno::RuntimeException); + +private: + /// reference to mutex of class deriving from here + ::osl::Mutex & m_rMutex; + + /// pImpl idiom implementation + ::std::auto_ptr< impl::ImplOPropertySet > m_pImplProperties; +}; + +} // namespace property + +// CHART_OPROPERTYSET_HXX +#endif diff --git a/chart2/source/inc/OStyle.hxx b/chart2/source/inc/OStyle.hxx new file mode 100644 index 000000000000..340a6407c7eb --- /dev/null +++ b/chart2/source/inc/OStyle.hxx @@ -0,0 +1,152 @@ +/************************************************************************* + * + * $RCSfile: OStyle.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_OSTYLE_HXX +#define CHART_OSTYLE_HXX + +#include "OPropertySet.hxx" + +#ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_ +#include <com/sun/star/style/XStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ +#include <com/sun/star/container/XNameAccess.hpp> +#endif + +namespace property +{ + +class OStyle : + public OPropertySet, + public ::com::sun::star::style::XStyle +{ +public: + OStyle( const ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess > &xStyleFamily, + ::osl::Mutex & rMutex ); + virtual ~OStyle(); + + ::osl::Mutex & GetMutex(); + +// inline SAL_CALL operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > () throw () +// { return static_cast< ::cppu::OWeakObject * >( this ); } + +protected: + + // ____ XStyle ____ + virtual sal_Bool SAL_CALL isUserDefined() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isInUse() + throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getParentStyle() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setParentStyle( const ::rtl::OUString& aParentStyle ) + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::uno::RuntimeException); + + // ____ XNamed (base of XStyle) ____ + virtual ::rtl::OUString SAL_CALL getName() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName( const ::rtl::OUString& aName ) + throw (::com::sun::star::uno::RuntimeException); + + // necessary overloads from OPropertySet + + // ____ XInterface ____ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) + throw (::com::sun::star::uno::RuntimeException); +// virtual void SAL_CALL acquire() throw (); +// virtual void SAL_CALL release() throw (); + + // ____ XServiceInfo ____ +// virtual ::rtl::OUString SAL_CALL +// getImplementationName() +// throw (::com::sun::star::uno::RuntimeException); +// virtual sal_Bool SAL_CALL +// supportsService( const ::rtl::OUString& ServiceName ) +// throw (::com::sun::star::uno::RuntimeException); +// virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL +// getSupportedServiceNames() +// throw (::com::sun::star::uno::RuntimeException); + + // ____ XTypeProvider ____ +// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL +// getTypes() +// throw (::com::sun::star::uno::RuntimeException); +// virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL +// getImplementationId() +// throw (::com::sun::star::uno::RuntimeException); + +private: + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess > m_xStyleFamily; + + ::rtl::OUString m_aName; + ::rtl::OUString m_aParentStyleName; + sal_Bool m_bUserDefined; + + ::osl::Mutex & m_rMutex; +}; + +} // namespace property + +// CHART_OSTYLE_HXX +#endif + diff --git a/chart2/source/inc/Scaling.hxx b/chart2/source/inc/Scaling.hxx new file mode 100644 index 000000000000..4993bdfe3bd6 --- /dev/null +++ b/chart2/source/inc/Scaling.hxx @@ -0,0 +1,203 @@ +/************************************************************************* + * + * $RCSfile: Scaling.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_SCALING_HXX +#define _CHART2_SCALING_HXX + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XSCALING_HPP_ +#include <drafts/com/sun/star/chart2/XScaling.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICENAME_HPP_ +#include <com/sun/star/lang/XServiceName.hpp> +#endif + +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include <cppuhelper/implbase2.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +class LogarithmicScaling : public ::cppu::WeakImplHelper2 < + ::drafts::com::sun::star::chart2::XScaling, + ::com::sun::star::lang::XServiceName + > +{ +public: + LogarithmicScaling(); + explicit LogarithmicScaling( double fBase ); + virtual ~LogarithmicScaling(); + + // ____ XScaling ____ + virtual double SAL_CALL + doScaling( double value ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XScaling > SAL_CALL + getInverseScaling() throw (::com::sun::star::uno::RuntimeException); + + // ____ XServiceName ____ + virtual ::rtl::OUString SAL_CALL getServiceName() + throw (::com::sun::star::uno::RuntimeException); + +private: + const double m_fBase; + const double m_fLogOfBase; +}; + +// ---------------------------------------- + +class ExponentialScaling : public ::cppu::WeakImplHelper2 < + ::drafts::com::sun::star::chart2::XScaling, + ::com::sun::star::lang::XServiceName + > +{ +public: + ExponentialScaling(); + explicit ExponentialScaling( double fBase ); + virtual ~ExponentialScaling(); + + // ____ XScaling ____ + virtual double SAL_CALL + doScaling( double value ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XScaling > SAL_CALL + getInverseScaling() throw (::com::sun::star::uno::RuntimeException); + + // ____ XServiceName ____ + virtual ::rtl::OUString SAL_CALL getServiceName() + throw (::com::sun::star::uno::RuntimeException); + +private: + const double m_fBase; +}; + +// ---------------------------------------- + +class LinearScaling : public ::cppu::WeakImplHelper2 < + ::drafts::com::sun::star::chart2::XScaling, + ::com::sun::star::lang::XServiceName + > +{ +public: + /// y(x) = fSlope * x + fOffset + LinearScaling( double fSlope, double fOffset ); + virtual ~LinearScaling(); + + // ____ XScaling ____ + virtual double SAL_CALL + doScaling( double value ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XScaling > SAL_CALL + getInverseScaling() throw (::com::sun::star::uno::RuntimeException); + + // ____ XServiceName ____ + virtual ::rtl::OUString SAL_CALL getServiceName() + throw (::com::sun::star::uno::RuntimeException); + +private: + const double m_fSlope; + const double m_fOffset; +}; + +// ---------------------------------------- + +class PowerScaling : public ::cppu::WeakImplHelper2 < + ::drafts::com::sun::star::chart2::XScaling, + ::com::sun::star::lang::XServiceName + > +{ +public: + PowerScaling( double fExponent ); + virtual ~PowerScaling(); + + // ____ XScaling ____ + virtual double SAL_CALL + doScaling( double value ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XScaling > SAL_CALL + getInverseScaling() throw (::com::sun::star::uno::RuntimeException); + + // ____ XServiceName ____ + virtual ::rtl::OUString SAL_CALL getServiceName() + throw (::com::sun::star::uno::RuntimeException); + +private: + const double m_fExponent; +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif + diff --git a/chart2/source/inc/ServiceMacros.hxx b/chart2/source/inc/ServiceMacros.hxx new file mode 100644 index 000000000000..1cafc76e3a81 --- /dev/null +++ b/chart2/source/inc/ServiceMacros.hxx @@ -0,0 +1,182 @@ +/************************************************************************* + * + * $RCSfile: ServiceMacros.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _APPHELPER_SERVICEMACROS_HXX +#define _APPHELPER_SERVICEMACROS_HXX + +/* +to use these macros the supported services and the implementation name needs to be static +especially you need to implement (declaration is contained in macro already): + +static com::sun::star::uno::Sequence< rtl::OUString > + Class::getSupportedServiceNames_Static(); +*/ + +//========================================================================= +// +// XServiceInfo decl +// +//========================================================================= +namespace apphelper +{ + +#define APPHELPER_XSERVICEINFO_DECL() \ + virtual ::rtl::OUString SAL_CALL \ + getImplementationName() \ + throw( ::com::sun::star::uno::RuntimeException ); \ + virtual sal_Bool SAL_CALL \ + supportsService( const ::rtl::OUString& ServiceName ) \ + throw( ::com::sun::star::uno::RuntimeException ); \ + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL \ + getSupportedServiceNames() \ + throw( ::com::sun::star::uno::RuntimeException ); \ + \ + static ::rtl::OUString getImplementationName_Static(); \ + static ::com::sun::star::uno::Sequence< ::rtl::OUString > \ + getSupportedServiceNames_Static(); + +//========================================================================= +// +// XServiceInfo impl +// +//========================================================================= + +#define APPHELPER_XSERVICEINFO_IMPL( Class, ImplName ) \ +::rtl::OUString SAL_CALL Class::getImplementationName() \ + throw( ::com::sun::star::uno::RuntimeException ) \ +{ \ + return getImplementationName_Static(); \ +} \ + \ +::rtl::OUString Class::getImplementationName_Static() \ +{ \ + return ImplName; \ +} \ + \ +sal_Bool SAL_CALL \ +Class::supportsService( const ::rtl::OUString& ServiceName ) \ + throw( ::com::sun::star::uno::RuntimeException ) \ +{ \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > aSNL = \ + getSupportedServiceNames(); \ + const ::rtl::OUString* pArray = aSNL.getArray(); \ + for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) \ + { \ + if( pArray[ i ] == ServiceName ) \ + return sal_True; \ + } \ + \ + return sal_False; \ +} \ + \ +::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL \ +Class::getSupportedServiceNames() \ + throw( ::com::sun::star::uno::RuntimeException ) \ +{ \ + return getSupportedServiceNames_Static(); \ +} + +//========================================================================= +// +// Service factory helper decl+impl +// +//to use this macro you need to provide a constructor: +//class( Reference< XComponentContext > const & xContext ) +//and implement OWeakObject +//========================================================================= + +#define APPHELPER_SERVICE_FACTORY_HELPER(Class) \ +static ::com::sun::star::uno::Reference< \ + ::com::sun::star::uno::XInterface > SAL_CALL \ + create( ::com::sun::star::uno::Reference< \ + ::com::sun::star::uno::XComponentContext > const & xContext) \ + throw(::com::sun::star::uno::Exception) \ +{ \ + return (::cppu::OWeakObject *)new Class( xContext ); \ +} + +/** This macro contains the default implementation for getImplementationId(). + Note, that you have to include the header necessary for rtl_createUuid. + Insert the following into your file: + + <code> +#ifndef _RTL_UUID_H_ +#include <rtl/uuid.h> +#endif + </code> + + @param Class the Class-Name for which getImplementationId() should be + implemented + */ +#define APPHELPER_GETIMPLEMENTATIONID_IMPL(Class) \ +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL Class::getImplementationId() \ + throw (::com::sun::star::uno::RuntimeException) \ +{ \ + static ::com::sun::star::uno::Sequence< sal_Int8 > aId; \ + if( aId.getLength() == 0 ) \ + { \ + aId.realloc( 16 ); \ + rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); \ + } \ + return aId; \ +} + +}//end namespace apphelper +#endif diff --git a/chart2/source/inc/TitleHelper.hxx b/chart2/source/inc/TitleHelper.hxx new file mode 100644 index 000000000000..85840d632baa --- /dev/null +++ b/chart2/source/inc/TitleHelper.hxx @@ -0,0 +1,127 @@ +/************************************************************************* + * + * $RCSfile: TitleHelper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_TOOLS_TITLEHELPER_HXX +#define _CHART2_TOOLS_TITLEHELPER_HXX + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTITLED_HPP_ +#include <drafts/com/sun/star/chart2/XTitled.hpp> +#endif + +#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_ +#include <com/sun/star/frame/XModel.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +class TitleHelper +{ +public: + enum eTitleType + { + MAIN_TITLE, + SUB_TITLE, + X_AXIS_TITLE, + Y_AXIS_TITLE, + Z_AXIS_TITLE, + SECOND_X_AXIS_TITLE, + SECOND_Y_AXIS_TITLE + }; + + static rtl::OUString getIdentifierForTitle( eTitleType nTitleIndex ); + + static ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XTitle > + getTitle( eTitleType nTitleIndex + , const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel >& xModel ); + + static ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XTitle > + createTitle( eTitleType nTitleIndex + , const rtl::OUString& rTitleText + , const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel >& xModel + , const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > & xContext ); + + static void removeTitle( eTitleType nTitleIndex + , const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel >& xModel ); + + static rtl::OUString getCompleteString( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XTitle >& xTitle ); + static void setCompleteString( const rtl::OUString& rNewText + , const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XTitle >& xTitle + , const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > & xContext ); +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/inc/chartview/ExplicitValueProvider.hxx b/chart2/source/inc/chartview/ExplicitValueProvider.hxx new file mode 100644 index 000000000000..35339c6eb114 --- /dev/null +++ b/chart2/source/inc/chartview/ExplicitValueProvider.hxx @@ -0,0 +1,96 @@ +/************************************************************************* + * + * $RCSfile: ExplicitValueProvider.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_EXPLICITVALUEPROVIDER_HXX +#define _CHART2_EXPLICITVALUEPROVIDER_HXX + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_EXPLICITINCREMENTDATA_HPP_ +#include <drafts/com/sun/star/chart2/ExplicitIncrementData.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_EXPLICITSCALEDATA_HPP_ +#include <drafts/com/sun/star/chart2/ExplicitScaleData.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XMETER_HPP_ +#include <drafts/com/sun/star/chart2/XMeter.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +class ExplicitValueProvider +{ +public: + virtual void getExplicitValuesForMeter( + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XMeter > xMeter + , ::drafts::com::sun::star::chart2::ExplicitScaleData& rExplicitScale + , ::drafts::com::sun::star::chart2::ExplicitIncrementData& rExplicitIncrement + , double& rfExplicitOrigin )=0; +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/inc/chartview/NumberFormatterWrapper.hxx b/chart2/source/inc/chartview/NumberFormatterWrapper.hxx new file mode 100644 index 000000000000..9bff634e1d67 --- /dev/null +++ b/chart2/source/inc/chartview/NumberFormatterWrapper.hxx @@ -0,0 +1,119 @@ +/************************************************************************* + * + * $RCSfile: NumberFormatterWrapper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_VIEW_NUMBERFORMATTERWRAPPER_HXX +#define _CHART2_VIEW_NUMBERFORMATTERWRAPPER_HXX + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_NUMBERFORMAT_HPP_ +#include <drafts/com/sun/star/chart2/NumberFormat.hpp> +#endif + +//only needed for temp numberformatter +#ifndef _ZFORLIST_HXX +#include <svtools/zforlist.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ +class FixedNumberFormatter; + +class NumberFormatterWrapper +{ +public: + NumberFormatterWrapper(); + virtual ~NumberFormatterWrapper(); + + ::drafts::com::sun::star::chart2::NumberFormat getNumberFormatForKey( sal_Int32 nIndex ) const; + sal_Int32 getKeyForNumberFormat( const ::drafts::com::sun::star::chart2::NumberFormat& rNumberFormat ) const; + + //this method should only be used by the ViewElementListProvider + SvNumberFormatter* getSvNumberFormatter() const; + +private: //private member + SvNumberFormatter* m_pNumberFormatter; + +friend class FixedNumberFormatter; +}; + + +class FixedNumberFormatter +{ +public: + FixedNumberFormatter( NumberFormatterWrapper* pNumberFormatterWrapper + , const ::drafts::com::sun::star::chart2::NumberFormat& rNumberFormat ); + virtual ~FixedNumberFormatter(); + + rtl::OUString getFormattedString( double fValue, sal_Int32& rLabelColor, bool& rbColorChanged ) const; + +private: + NumberFormatterWrapper* m_pNumberFormatterWrapper; + ULONG m_nFormatIndex; +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/inc/chartview/servicenames_charttypes.hxx b/chart2/source/inc/chartview/servicenames_charttypes.hxx new file mode 100644 index 000000000000..7605e744a23b --- /dev/null +++ b/chart2/source/inc/chartview/servicenames_charttypes.hxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * $RCSfile: servicenames_charttypes.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_SERVICENAMES_CHARTTYPES_HXX +#define _CHART2_SERVICENAMES_CHARTTYPES_HXX + +//............................................................................. +namespace chart +{ +//............................................................................. + +#define CHART2_VIEW_BARCHART_SERVICE_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.chart2.BarChart_Impl") +#define CHART2_VIEW_BARCHART_SERVICE_NAME ::rtl::OUString::createFromAscii("com.sun.star.chart2.BarChart") + +#define CHART2_VIEW_PIECHART_SERVICE_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.chart2.PieChart_Impl") +#define CHART2_VIEW_PIECHART_SERVICE_NAME ::rtl::OUString::createFromAscii("com.sun.star.chart2.PieChart") + +#define CHART2_VIEW_AREACHART_SERVICE_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.chart2.AreaChart_Impl") +#define CHART2_VIEW_AREACHART_SERVICE_NAME ::rtl::OUString::createFromAscii("com.sun.star.chart2.AreaChart") + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/inc/exports.dxp b/chart2/source/inc/exports.dxp new file mode 100644 index 000000000000..9630d7e06768 --- /dev/null +++ b/chart2/source/inc/exports.dxp @@ -0,0 +1,3 @@ +component_getImplementationEnvironment +component_writeInfo +component_getFactory diff --git a/chart2/source/inc/macros.hxx b/chart2/source/inc/macros.hxx new file mode 100644 index 000000000000..30626d40d392 --- /dev/null +++ b/chart2/source/inc/macros.hxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * $RCSfile: macros.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2002 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_MACROS_HXX +#define CHART_MACROS_HXX + +/// creates a unicode-string from an ASCII string +#define C2U(constAsciiStr) (::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( constAsciiStr ) )) + +/// shows an error-box for an exception ex +#define ASSERT_EXCEPTION(ex) \ + OSL_ENSURE( false, ::rtl::OUStringToOString( \ + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught: " )) + \ + ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr()); + +#define U2C(ouString) (::rtl::OUStringToOString(ouString,RTL_TEXTENCODING_ASCII_US).getStr()) + +// CHART_MACROS_HXX +#endif diff --git a/chart2/source/inc/servicenames.hxx b/chart2/source/inc/servicenames.hxx new file mode 100644 index 000000000000..300ea20e9c8a --- /dev/null +++ b/chart2/source/inc/servicenames.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * $RCSfile: servicenames.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART_SERVICENAMES_HXX +#define _CHART_SERVICENAMES_HXX + +//............................................................................. +namespace chart +{ +//............................................................................. + +#define CHART_MODEL_SERVICE_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.comp.chart2.ChartModel") +#define CHART_MODEL_SERVICE_NAME ::rtl::OUString::createFromAscii("com.sun.star.chart2.ChartModel") +//@todo create your own service containing the service com.sun.star.document.OfficeDocument + +#define CHART_CONTROLLER_SERVICE_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.comp.chart2.ChartController") +#define CHART_CONTROLLER_SERVICE_NAME ::rtl::OUString::createFromAscii("com.sun.star.chart2.ChartController") +//@todo create your own service containing the service com.sun.star.frame.Controller + +#define CHART_FRAMELOADER_SERVICE_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.comp.chart2.ChartFrameLoader") +#define CHART_FRAMELOADER_SERVICE_NAME ::rtl::OUString::createFromAscii("com.sun.star.frame.SynchronousFrameLoader") + +//............................................................................. +} //namespace chart +//............................................................................. + +#endif diff --git a/chart2/source/inc/servicenames_dlwrapper.hxx b/chart2/source/inc/servicenames_dlwrapper.hxx new file mode 100644 index 000000000000..31885e6447d6 --- /dev/null +++ b/chart2/source/inc/servicenames_dlwrapper.hxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * $RCSfile: servicenames_dlwrapper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_SERVICENAMES_DLWRAPPER_HXX +#define _CHART2_SERVICENAMES_DLWRAPPER_HXX + +//............................................................................. +namespace chart +{ +//............................................................................. + +#define CHART2_VIEW_DLWRAPPER_SERVICE_IMPLEMENTATION_NAME ::rtl::OUString::createFromAscii("com.sun.star.chart2.DrawModelWrapper") +#define CHART2_VIEW_DLWRAPPER_SERVICE_NAME ::rtl::OUString::createFromAscii("com.sun.star.chart2.DrawModelWrapper") + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/model/inc/ChartTypeManager.hxx b/chart2/source/model/inc/ChartTypeManager.hxx new file mode 100644 index 000000000000..ef59d5d53c16 --- /dev/null +++ b/chart2/source/model/inc/ChartTypeManager.hxx @@ -0,0 +1,172 @@ +/************************************************************************* + * + * $RCSfile: ChartTypeManager.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_CHARTTYPEMANAGER_HXX +#define CHART_CHARTTYPEMANAGER_HXX + +#ifndef CHART_OPROPERTYSET_HXX +#include "OPropertySet.hxx" +#endif +#ifndef CHART_MUTEXCONTAINER_HXX +#include "MutexContainer.hxx" +#endif + +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include <cppuhelper/implbase2.hxx> +#endif +#ifndef _COMPHELPER_UNO3_HXX_ +#include <comphelper/uno3.hxx> +#endif +#include "ServiceMacros.hxx" + +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#endif +// #ifndef _COM_SUN_STAR_LANG_XMULTICOMPONENTFACTORY_HPP_ +// #include <com/sun/star/lang/XMultiComponentFactory.hpp> +// #endif + +#include <drafts/com/sun/star/chart2/XChartTypeManager.hpp> + +// #include <map> + +namespace chart +{ + +namespace impl +{ +typedef ::cppu::WeakImplHelper2< + ::com::sun::star::lang::XMultiServiceFactory, +// ::com::sun::star::lang::XMultiComponentFactory, + ::drafts::com::sun::star::chart2::XChartTypeManager > + ChartTypeManager_Base; +} + +class ChartTypeManager : + public helper::MutexContainer, + public impl::ChartTypeManager_Base, + public ::property::OPropertySet +{ +public: + explicit ChartTypeManager( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext ); + virtual ~ChartTypeManager(); + + APPHELPER_XSERVICEINFO_DECL() + /// establish methods for factory instatiation + APPHELPER_SERVICE_FACTORY_HELPER( ChartTypeManager ) + +protected: + // ____ XMultiServiceFactory ____ + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier ) + throw (::com::sun::star::uno::Exception, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( + const ::rtl::OUString& ServiceSpecifier, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Any >& Arguments ) + throw (::com::sun::star::uno::Exception, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::rtl::OUString > SAL_CALL getAvailableServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + +// virtual sal_Bool SAL_CALL convertFastPropertyValue +// ( ::com::sun::star::uno::Any & rConvertedValue, +// ::com::sun::star::uno::Any & rOldValue, +// sal_Int32 nHandle, +// const ::com::sun::star::uno::Any& rValue ) +// throw (::com::sun::star::lang::IllegalArgumentException); + + // ____ XChartTypeManager ____ + // currently empty + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + m_xContext; +}; + +} // namespace chart + +// CHART_CHARTTYPEMANAGER_HXX +#endif diff --git a/chart2/source/model/inc/DataSeriesTree.hxx b/chart2/source/model/inc/DataSeriesTree.hxx new file mode 100644 index 000000000000..cc560325a4a8 --- /dev/null +++ b/chart2/source/model/inc/DataSeriesTree.hxx @@ -0,0 +1,131 @@ +/************************************************************************* + * + * $RCSfile: DataSeriesTree.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_DATASERIESTREE_HXX +#define CHART_DATASERIESTREE_HXX + +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include <cppuhelper/implbase2.hxx> +#endif + +#include "ServiceMacros.hxx" + +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDATASERIESTREEPARENT_HPP_ +#include <drafts/com/sun/star/chart2/XDataSeriesTreeParent.hpp> +#endif + +#include <vector> + +namespace chart +{ + +class DataSeriesTree : public + ::cppu::WeakImplHelper2< + ::com::sun::star::lang::XServiceInfo, + ::drafts::com::sun::star::chart2::XDataSeriesTreeParent > +{ +public: + DataSeriesTree( const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > & xContext ); + virtual ~DataSeriesTree(); + + /// declare XServiceInfo methods + APPHELPER_XSERVICEINFO_DECL() + /// establish methods for factory instatiation + APPHELPER_SERVICE_FACTORY_HELPER( DataSeriesTree ) + +protected: + + // ____ XDataSeriesTreeParent ____ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XDataSeriesTreeNode > > + SAL_CALL getChildren() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addChild( + const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XDataSeriesTreeNode >& aNode ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeChild( + const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XDataSeriesTreeNode >& aNode ) + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::uno::RuntimeException); + + // ____ XDataSeriesTreeNode ____ + +private: + typedef ::std::vector< ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeriesTreeNode > > + m_tChildType; + + m_tChildType m_aChildren; + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + m_xContext; +}; + +} // namespace chart + +// CHART_DATASERIESTREE_HXX +#endif diff --git a/chart2/source/model/inc/Diagram.hxx b/chart2/source/model/inc/Diagram.hxx new file mode 100644 index 000000000000..b8247b65a15c --- /dev/null +++ b/chart2/source/model/inc/Diagram.hxx @@ -0,0 +1,310 @@ +/************************************************************************* + * + * $RCSfile: Diagram.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_DIAGRAM_HXX +#define CHART_DIAGRAM_HXX + +#ifndef CHART_OPROPERTYSET_HXX +#include "OPropertySet.hxx" +#endif +#ifndef CHART_MUTEXCONTAINER_HXX +#include "MutexContainer.hxx" +#endif + +#ifndef _CPPUHELPER_IMPLBASE8_HXX_ +#include <cppuhelper/implbase8.hxx> +#endif +#ifndef _COMPHELPER_UNO3_HXX_ +#include <comphelper/uno3.hxx> +#endif + +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDIAGRAM_HPP_ +#include <drafts/com/sun/star/chart2/XDiagram.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTELEMENT_HPP_ +#include <drafts/com/sun/star/chart2/XChartElement.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XAXISCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XAxisContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XBOUNDEDCOORDINATESYSTEMCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XBoundedCoordinateSystemContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XGRIDCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XGridContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTITLED_HPP_ +#include <drafts/com/sun/star/chart2/XTitled.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_LAYOUT_XLAYOUTELEMENT_HPP_ +#include <drafts/com/sun/star/layout/XLayoutElement.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XIDENTIFIABLE_HPP_ +#include <drafts/com/sun/star/chart2/XIdentifiable.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif + +#include "ServiceMacros.hxx" + +#include <map> +// #include <set> +#include <vector> + +namespace chart +{ + +namespace impl +{ +typedef ::cppu::WeakImplHelper8< + ::drafts::com::sun::star::chart2::XDiagram, + ::com::sun::star::lang::XServiceInfo, + ::drafts::com::sun::star::chart2::XAxisContainer, + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystemContainer, + ::drafts::com::sun::star::chart2::XGridContainer, + ::drafts::com::sun::star::chart2::XTitled, + ::drafts::com::sun::star::layout::XLayoutElement, + ::drafts::com::sun::star::chart2::XIdentifiable > + Diagram_Base; +} + +class Diagram : + public helper::MutexContainer, + public impl::Diagram_Base, + public ::property::OPropertySet +{ +public: + Diagram( ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext ); + virtual ~Diagram(); + + /// establish methods for factory instatiation + APPHELPER_SERVICE_FACTORY_HELPER( Diagram ) + + /// XServiceInfo declarations + APPHELPER_XSERVICEINFO_DECL() + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +protected: + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + +// virtual sal_Bool SAL_CALL convertFastPropertyValue +// ( ::com::sun::star::uno::Any & rConvertedValue, +// ::com::sun::star::uno::Any & rOldValue, +// sal_Int32 nHandle, +// const ::com::sun::star::uno::Any& rValue ) +// throw (::com::sun::star::lang::IllegalArgumentException); + + // ____ XDiagram ____ + virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XDataSeriesTreeParent > + SAL_CALL getTree() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTree( + const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XDataSeriesTreeParent >& xTree ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > SAL_CALL getWall() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XLegend > SAL_CALL getLegend() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setLegend( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XLegend >& xLegend ) + throw (::com::sun::star::uno::RuntimeException); + + // ____ XAxisContainer ____ + virtual void SAL_CALL addAxis( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XAxis >& aAxis ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeAxis( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XAxis >& aAxis ) + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XAxis > > SAL_CALL getAxes() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XAxis > SAL_CALL getAxisByIdentifier( + const ::rtl::OUString& aIdentifier ) + throw (::com::sun::star::uno::RuntimeException); + + // ____ XBoundedCoordinateSystemContainer ____ + virtual void SAL_CALL addCoordinateSystem( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem >& aCoordSys ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeCoordinateSystem( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem >& aCoordSys ) + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > > SAL_CALL getCoordinateSystems() + throw (::com::sun::star::uno::RuntimeException); + + // ____ XGridContainer ____ + virtual void SAL_CALL addGrid( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XGrid >& aGrid ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeGrid( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XGrid >& aGrid ) + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XGrid > > SAL_CALL getGrids() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XGrid > SAL_CALL getGridByIdentifier( + const ::rtl::OUString& aIdentifier ) + throw (::com::sun::star::uno::RuntimeException); + + // ____ XTitled ____ + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XTitle > SAL_CALL getTitle() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTitle( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XTitle >& Title ) + throw (::com::sun::star::uno::RuntimeException); + + // ____ XLayoutElement ____ + // (empty) + + // ____ XIdentifiable ____ + virtual ::rtl::OUString SAL_CALL getIdentifier() + throw (::com::sun::star::uno::RuntimeException); + +private: + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > m_xContext; + +// ::std::vector< ::drafts::com::sun::star::chart2::DataSeriesGroup > +// m_aSeriesGroups; + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeriesTreeParent > m_xSeriesTree; + + typedef + ::std::map< + ::rtl::OUString, + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XAxis > > + tAxisContainerType; + typedef + ::std::map< + ::rtl::OUString, + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XGrid > > + tGridContainerType; + + tAxisContainerType m_aAxes; + tGridContainerType m_aGrids; + +// ::std::set< ::com::sun::star::uno::Reference< +// ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > > +// m_aCoordSystems; + ::std::vector< ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > > + m_aCoordSystems; + + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > + m_xWall; + + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XTitle > + m_xTitle; + + ::rtl::OUString m_aIdentifier; + + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XLegend > + m_xLegend; +}; + +} // namespace chart + +// CHART_DIAGRAM_HXX +#endif diff --git a/chart2/source/model/inc/PolarCoordinateSystem.hxx b/chart2/source/model/inc/PolarCoordinateSystem.hxx new file mode 100644 index 000000000000..4754833c07d0 --- /dev/null +++ b/chart2/source/model/inc/PolarCoordinateSystem.hxx @@ -0,0 +1,113 @@ +/************************************************************************* + * + * $RCSfile: PolarCoordinateSystem.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2002 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART_POLARCOORDINATESYSTEM_HXX +#define _CHART_POLARCOORDINATESYSTEM_HXX + +#include "ServiceMacros.hxx" + +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include <cppuhelper/implbase2.hxx> +#endif + +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCOORDINATESYSTEM_HPP_ +#include <drafts/com/sun/star/chart2/XCoordinateSystem.hpp> +#endif + +namespace chart +{ + +class PolarCoordinateSystem : public ::cppu::WeakImplHelper2< + ::com::sun::star::lang::XServiceInfo, + ::drafts::com::sun::star::chart2::XCoordinateSystem + > +{ +public: + explicit PolarCoordinateSystem( sal_Int32 nDim = 2 ); + virtual ~PolarCoordinateSystem(); + + // ____ XCoordinateSystem ____ + // ___________________________ + /// @see ::drafts::com::sun::star::chart2::XCoordinateSystem + virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation > SAL_CALL getTransformationToCartesian() + throw (::com::sun::star::uno::RuntimeException); + /// @see ::drafts::com::sun::star::chart2::XCoordinateSystem + virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation > SAL_CALL getTransformationFromCartesian() + throw (::com::sun::star::uno::RuntimeException); + /// @see ::drafts::com::sun::star::chart2::XCoordinateSystem + virtual sal_Int32 SAL_CALL getDimension() throw (::com::sun::star::uno::RuntimeException); + + APPHELPER_XSERVICEINFO_DECL() + +private: + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation > + m_aTransformationToCartesian; + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation > + m_aTransformationFromCartesian; + sal_Int32 m_nDim; +}; + +} // namespace chart + +// _CHART_POLARCOORDINATESYSTEM_HXX +#endif diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx new file mode 100644 index 000000000000..9b5189769b41 --- /dev/null +++ b/chart2/source/model/main/Axis.cxx @@ -0,0 +1,510 @@ +/************************************************************************* + * + * $RCSfile: Axis.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Axis.hxx" +#include "macros.hxx" +#include "CharacterProperties.hxx" +#include "UserDefinedProperties.hxx" +#include "algohelper.hxx" +#include "PropertyHelper.hxx" +#include "Increment.hxx" + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_ +#include <com/sun/star/lang/Locale.hpp> +#endif + +#ifndef _DRAFTS_COM_SUN_STAR_LAYOUT_ALIGNMENT_HPP_ +#include <drafts/com/sun/star/layout/Alignment.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_LAYOUT_STRETCHMODE_HPP_ +#include <drafts/com/sun/star/layout/StretchMode.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_NUMBERFORMAT_HPP_ +#include <drafts/com/sun/star/chart2/NumberFormat.hpp> +#endif + +#ifndef _COM_SUN_STAR_DRAWING_LINESTYLE_HPP_ +#include <com/sun/star/drawing/LineStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_LINEDASH_HPP_ +#include <com/sun/star/drawing/LineDash.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_LINEJOINT_HPP_ +#include <com/sun/star/drawing/LineJoint.hpp> +#endif +#ifndef _COM_SUN_STAR_CHART_CHARTAXISARRANGEORDERTYPE_HPP_ +#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp> +#endif + +#ifndef _RTL_UUID_H_ +#include <rtl/uuid.h> +#endif +#ifndef _CPPUHELPER_QUERYINTERFACE_HXX_ +#include <cppuhelper/queryinterface.hxx> +#endif + +#include <vector> +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans::PropertyAttribute; +using namespace ::drafts::com::sun::star; + +using ::com::sun::star::beans::Property; +using ::osl::MutexGuard; + +namespace +{ + +static const ::rtl::OUString lcl_aServiceName( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.Axis" )); + +enum +{ + PROP_AXIS_DISPLAY_LABELS, + PROP_AXIS_TEXT_ROTATION, + PROP_AXIS_TEXT_BREAK, + PROP_AXIS_TEXT_OVERLAP, + PROP_AXIS_TEXT_STACKED, + PROP_AXIS_TEXT_ARRANGE_ORDER, + PROP_AXIS_NUMBER_FORMAT, + + // for Testing only! + PROP_AXIS_MAJOR_TICKMARKS, + // for Testing only! + PROP_AXIS_MINOR_TICKMARKS, + + // com.sun.star.drawing.LineProperties + PROP_AXIS_LINE_STYLE, + PROP_AXIS_LINE_WIDTH, + PROP_AXIS_LINE_DASH, + PROP_AXIS_LINE_COLOR, + PROP_AXIS_LINE_TRANSPARENCE, + PROP_AXIS_LINE_JOINT +}; + +void lcl_AddPropertiesToVector( + ::std::vector< Property > & rOutProperties ) +{ + rOutProperties.push_back( + Property( C2U( "DisplayLabels" ), + PROP_AXIS_DISPLAY_LABELS, + ::getBooleanCppuType(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "TextRotation" ), + PROP_AXIS_TEXT_ROTATION, + ::getCppuType( reinterpret_cast< const double * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "TextBreak" ), + PROP_AXIS_TEXT_BREAK, + ::getBooleanCppuType(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "TextOverlap" ), + PROP_AXIS_TEXT_OVERLAP, + ::getBooleanCppuType(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "StackCharacters" ), + PROP_AXIS_TEXT_STACKED, + ::getBooleanCppuType(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "ArrangeOrder" ), + PROP_AXIS_TEXT_ARRANGE_ORDER, + ::getCppuType( reinterpret_cast< const ::com::sun::star::chart::ChartAxisArrangeOrderType * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "NumberFormat" ), + PROP_AXIS_NUMBER_FORMAT, + ::getCppuType( reinterpret_cast< const chart2::NumberFormat * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + // for Testing only! + rOutProperties.push_back( + Property( C2U( "MajorTickmarks" ), + PROP_AXIS_MAJOR_TICKMARKS, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + // for Testing only! + rOutProperties.push_back( + Property( C2U( "MinorTickmarks" ), + PROP_AXIS_MINOR_TICKMARKS, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + // com.sun.star.drawing.LineProperties + // ----------------------------------- + rOutProperties.push_back( + Property( C2U( "LineStyle" ), + PROP_AXIS_LINE_STYLE, + ::getCppuType( reinterpret_cast< const drawing::LineStyle * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + rOutProperties.push_back( + Property( C2U( "LineWidth" ), + PROP_AXIS_LINE_WIDTH, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + rOutProperties.push_back( + Property( C2U( "LineDash" ), + PROP_AXIS_LINE_DASH, + ::getCppuType( reinterpret_cast< const drawing::LineDash * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEVOID )); + rOutProperties.push_back( + Property( C2U( "LineColor" ), + PROP_AXIS_LINE_COLOR, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + rOutProperties.push_back( + Property( C2U( "LineTransparence" ), + PROP_AXIS_LINE_TRANSPARENCE, + ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + rOutProperties.push_back( + Property( C2U( "LineJoint" ), + PROP_AXIS_LINE_JOINT, + ::getCppuType( reinterpret_cast< const drawing::LineJoint * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); +} + +void lcl_AddDefaultsToMap( + ::chart::helper::tPropertyValueMap & rOutMap ) +{ + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_DISPLAY_LABELS )); + rOutMap[ PROP_AXIS_DISPLAY_LABELS ] = + uno::makeAny( sal_Bool( sal_True ) ); + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_TEXT_ROTATION )); + rOutMap[ PROP_AXIS_TEXT_ROTATION ] = + uno::makeAny( double( 0.0 ) ); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_TEXT_BREAK )); + rOutMap[ PROP_AXIS_TEXT_BREAK ] = + uno::makeAny( sal_Bool( sal_True ) ); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_TEXT_OVERLAP )); + rOutMap[ PROP_AXIS_TEXT_OVERLAP ] = + uno::makeAny( sal_Bool( sal_False ) ); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_TEXT_STACKED )); + rOutMap[ PROP_AXIS_TEXT_STACKED ] = + uno::makeAny( sal_Bool( sal_False ) ); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_TEXT_ARRANGE_ORDER )); + rOutMap[ PROP_AXIS_TEXT_ARRANGE_ORDER ] = + uno::makeAny( ::com::sun::star::chart::ChartAxisArrangeOrderType_AUTO ); + chart2::NumberFormat aFormat( C2U( "Standard" ), + lang::Locale( C2U( "DE" ), C2U( "de" ), ::rtl::OUString())); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_NUMBER_FORMAT )); + rOutMap[ PROP_AXIS_NUMBER_FORMAT ] = + uno::makeAny( aFormat ); + + // for Testing only! + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_MAJOR_TICKMARKS )); + rOutMap[ PROP_AXIS_MAJOR_TICKMARKS ] = + uno::makeAny( sal_Int32( 2 /* CHAXIS_MARK_OUTER */ ) ); + // for Testing only! + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_MINOR_TICKMARKS )); + rOutMap[ PROP_AXIS_MINOR_TICKMARKS ] = + uno::makeAny( sal_Int32( 0 /* CHAXIS_MARK_NONE */ ) ); + + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_LINE_STYLE )); + rOutMap[ PROP_AXIS_LINE_STYLE ] = + uno::makeAny( drawing::LineStyle_SOLID ); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_LINE_WIDTH )); + rOutMap[ PROP_AXIS_LINE_WIDTH ] = + uno::makeAny( sal_Int32( 0 ) ); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_LINE_COLOR )); + rOutMap[ PROP_AXIS_LINE_COLOR ] = + uno::makeAny( sal_Int32( 0x000000 ) ); // black + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_LINE_TRANSPARENCE )); + rOutMap[ PROP_AXIS_LINE_TRANSPARENCE ] = + uno::makeAny( sal_Int16( 0 ) ); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_AXIS_LINE_JOINT )); + rOutMap[ PROP_AXIS_LINE_JOINT ] = + uno::makeAny( drawing::LineJoint_NONE ); +} + +const uno::Sequence< Property > & lcl_GetPropertySequence() +{ + static uno::Sequence< Property > aPropSeq; + + // /-- + MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + lcl_AddPropertiesToVector( aProperties ); + ::chart::CharacterProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ true ); + ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::helper::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::helper::VectorToSequence( aProperties ); + } + + return aPropSeq; +} + +::cppu::IPropertyArrayHelper & lcl_getInfoHelper() +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( + lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + +} // anonymous namespace + +// ================================================================================ + +namespace chart +{ + +Axis::Axis( uno::Reference< uno::XComponentContext > const & xContext ) : + ::property::OPropertySet( m_aMutex ) +{ + m_xIncrement = new Increment(); + + if( ! ( xContext->getValueByName( C2U( "Identifier" )) >>= m_aIdentifier )) + { + OSL_ENSURE( false, "Missing Axis identifier" ); + } + +#if OSL_DEBUG_LEVEL > 1 + OSL_TRACE( "Axis CTOR: Id=%s", U2C( m_aIdentifier )); +#endif +} + +Axis::~Axis() +{ +} + +// -------------------------------------------------------------------------------- + +// ____ XAxis ____ +// (nothing) + +// ____ XMeter ____ +void SAL_CALL Axis::attachCoordinateSystem( + const uno::Reference< chart2::XBoundedCoordinateSystem >& xCoordSys, + sal_Int32 nRepresentedDimension ) + throw (lang::IndexOutOfBoundsException, + uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex()); + if( nRepresentedDimension >= xCoordSys->getDimension()) + throw lang::IndexOutOfBoundsException(); + + m_xCoordinateSystem = xCoordSys; + m_nRepresentedDimension = nRepresentedDimension; + // \-- +} + +uno::Reference< chart2::XBoundedCoordinateSystem > SAL_CALL Axis::getCoordinateSystem() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex()); + return m_xCoordinateSystem; + // \-- +} + +sal_Int32 SAL_CALL Axis::getRepresentedDimension() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex()); + return m_nRepresentedDimension; + // \-- +} + +void SAL_CALL Axis::setIncrement( const uno::Reference< chart2::XIncrement >& aIncrement ) + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex()); + m_xIncrement = aIncrement; + // \-- +} + +uno::Reference< chart2::XIncrement > SAL_CALL Axis::getIncrement() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex()); + return m_xIncrement; + // \-- +} + +// ____ XIdentifiable ____ +::rtl::OUString SAL_CALL Axis::getIdentifier() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex()); + return m_aIdentifier; + // \-- +} + +// ================================================================================ + +// ____ OPropertySet ____ +uno::Any Axis::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static helper::tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + // initialize defaults + lcl_AddDefaultsToMap( aStaticDefaults ); + CharacterProperties::AddDefaultsToMap( + aStaticDefaults, + /* bIncludeStyleProperties = */ true ); + } + + helper::tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + return uno::Any(); + + return (*aFound).second; + // \-- +} + +::cppu::IPropertyArrayHelper & SAL_CALL Axis::getInfoHelper() +{ + return lcl_getInfoHelper(); +} + + +// ____ XPropertySet ____ +uno::Reference< beans::XPropertySetInfo > SAL_CALL + Axis::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static uno::Reference< beans::XPropertySetInfo > xInfo; + + // /-- + MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +// ================================================================================ + +uno::Sequence< ::rtl::OUString > Axis::getSupportedServiceNames_Static() +{ + uno::Sequence< ::rtl::OUString > aServices( 3 ); + aServices[ 0 ] = C2U( "drafts.com.sun.star.chart2.Axis" ); + aServices[ 1 ] = C2U( "drafts.com.sun.star.chart2.ChartElement" ); + aServices[ 2 ] = C2U( "com.sun.star.beans.PropertySet" ); + return aServices; +} + +using impl::Axis_Base; + +IMPLEMENT_FORWARD_XINTERFACE2( Axis, Axis_Base, ::property::OPropertySet ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( Axis, Axis_Base, ::property::OPropertySet ) + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( Axis, lcl_aServiceName ); + +} // namespace chart diff --git a/chart2/source/model/main/Axis.hxx b/chart2/source/model/main/Axis.hxx new file mode 100644 index 000000000000..7ff3d0068691 --- /dev/null +++ b/chart2/source/model/main/Axis.hxx @@ -0,0 +1,187 @@ +/************************************************************************* + * + * $RCSfile: Axis.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_AXIS_HXX +#define CHART_AXIS_HXX + +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif + +#ifndef CHART_MUTEXCONTAINER_HXX +#include "MutexContainer.hxx" +#endif +#ifndef CHART_OPROPERTYSET_HXX +#include "OPropertySet.hxx" +#endif + +#ifndef _CPPUHELPER_IMPLBASE3_HXX_ +#include <cppuhelper/implbase3.hxx> +#endif +#ifndef _COMPHELPER_UNO3_HXX_ +#include <comphelper/uno3.hxx> +#endif + +#include "ServiceMacros.hxx" + +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XAXIS_HPP_ +#include <drafts/com/sun/star/chart2/XAxis.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XIDENTIFIABLE_HPP_ +#include <drafts/com/sun/star/chart2/XIdentifiable.hpp> +#endif + +namespace chart +{ + +namespace impl +{ +typedef ::cppu::WeakImplHelper3< + ::drafts::com::sun::star::chart2::XAxis, + ::drafts::com::sun::star::chart2::XIdentifiable, + ::com::sun::star::lang::XServiceInfo > + Axis_Base; +} + +class Axis : + public helper::MutexContainer, + public impl::Axis_Base, + public ::property::OPropertySet +{ +public: + Axis( ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext ); + virtual ~Axis(); + + /// establish methods for factory instatiation + APPHELPER_SERVICE_FACTORY_HELPER( Axis ) + /// XServiceInfo declarations + APPHELPER_XSERVICEINFO_DECL() + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +protected: + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + +// virtual sal_Bool SAL_CALL convertFastPropertyValue +// ( ::com::sun::star::uno::Any & rConvertedValue, +// ::com::sun::star::uno::Any & rOldValue, +// sal_Int32 nHandle, +// const ::com::sun::star::uno::Any& rValue ) +// throw (::com::sun::star::lang::IllegalArgumentException); + + // ____ XAxis ____ + + // ____ XMeter ____ + virtual void SAL_CALL attachCoordinateSystem( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem >& xCoordSys, + sal_Int32 nRepresentedDimension ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > SAL_CALL getCoordinateSystem() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getRepresentedDimension() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setIncrement( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XIncrement >& aIncrement ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XIncrement > SAL_CALL getIncrement() + throw (::com::sun::star::uno::RuntimeException); + + // ____ XIdentifiable ____ + virtual ::rtl::OUString SAL_CALL getIdentifier() + throw (::com::sun::star::uno::RuntimeException); + +private: + ::rtl::OUString m_aIdentifier; + + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > + m_xCoordinateSystem; + sal_Int32 m_nRepresentedDimension; + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XIncrement > + m_xIncrement; +}; + +} // namespace chart + +// CHART_AXIS_HXX +#endif diff --git a/chart2/source/model/main/CartesianCoordinateSystem.cxx b/chart2/source/model/main/CartesianCoordinateSystem.cxx new file mode 100644 index 000000000000..be117ce2b6d1 --- /dev/null +++ b/chart2/source/model/main/CartesianCoordinateSystem.cxx @@ -0,0 +1,116 @@ +/************************************************************************* + * + * $RCSfile: CartesianCoordinateSystem.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2002 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "CartesianCoordinateSystem.hxx" +#include "IdentityTransformation.hxx" +#include "macros.hxx" + +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::uno::Sequence; +using ::rtl::OUString; + +namespace chart +{ + +CartesianCoordinateSystem::CartesianCoordinateSystem( sal_Int32 nDim /* = 2 */ ) : + m_aTransformationToCartesian( new IdentityTransformation( nDim ) ), + m_aTransformationFromCartesian( new IdentityTransformation( nDim ) ), + m_nDim( nDim ) +{ +} + +CartesianCoordinateSystem::~CartesianCoordinateSystem() +{} + +// ____ XCoordinateSystem ____ +::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation > SAL_CALL + CartesianCoordinateSystem::getTransformationToCartesian() + throw (RuntimeException) +{ + return m_aTransformationToCartesian; +} + +::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation > SAL_CALL + CartesianCoordinateSystem::getTransformationFromCartesian() + throw (RuntimeException) +{ + return m_aTransformationFromCartesian; +} + +sal_Int32 SAL_CALL CartesianCoordinateSystem::getDimension() throw (RuntimeException) +{ + return m_nDim; +} + + +// ____ XServiceInfo ____ + +Sequence< OUString > CartesianCoordinateSystem::getSupportedServiceNames_Static() +{ + Sequence< OUString > aServices; +// Sequence< OUString > aServices( 1 ); +// aServices[ 0 ] = OUString( RTL_CONSTASCII_USTRINGPARAM( "drafts.com.sun.star.chart2.CoordinateSystem" )); + return aServices; +} + +APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem, + C2U( "com.sun.star.comp.chart.CartesianCoordinateSystem" )) + +} // namespace chart diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx new file mode 100644 index 000000000000..689a37096f90 --- /dev/null +++ b/chart2/source/model/main/ChartModel.cxx @@ -0,0 +1,923 @@ +/************************************************************************* + * + * $RCSfile: ChartModel.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ChartModel.hxx" +#include "ImplChartModel.hxx" +#include "servicenames.hxx" +#include "MediaDescriptorHelper.hxx" + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_ +#include <com/sun/star/uno/Reference.h> +#endif + +#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_ +#include <com/sun/star/lang/DisposedException.hpp> +#endif + +#ifndef _COM_SUN_STAR_VIEW_XSELECTIONSUPPLIER_HPP_ +#include <com/sun/star/view/XSelectionSupplier.hpp> +#endif + +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Reference; +using ::rtl::OUString; +using ::osl::MutexGuard; + +using namespace ::drafts::com::sun::star; +using namespace ::com::sun::star; +using namespace ::apphelper; + +//----------------------------------------------------------------- +// ChartModel Constructor and Destructor +//----------------------------------------------------------------- + +namespace chart +{ + +ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext) + : m_aLifeTimeManager( this, this ) + , m_bReadOnly( sal_False ) + , m_bModified( sal_False ) + , m_aResource() + , m_pControllers( NULL ) + , m_xCurrentController( NULL ) + , m_nControllerLockCount(0) + , m_pImplChartModel( new impl::ImplChartModel( xContext ) ) +{ + OSL_TRACE( "ChartModel: CTOR" ); +} + +ChartModel::~ChartModel() +{ + //@todo + + if ( m_pControllers ) + delete m_pControllers; +} + +//----------------------------------------------------------------- +// private methods +//----------------------------------------------------------------- + + ::rtl::OUString ChartModel +::impl_g_getLocation() +{ + + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall()) + return ::rtl::OUString(); //behave passive if already disposed or closed or throw exception @todo? + //mutex is acquired + return m_aResource; +} + + ::cppu::OInterfaceContainerHelper* ChartModel +::impl_getControllerContainer() throw(uno::RuntimeException) +{ + if ( m_pControllers ) + return m_pControllers; + m_pControllers = + new ::cppu::OInterfaceContainerHelper( m_aModelMutex ); + return m_pControllers; +} + + sal_Bool ChartModel +::impl_isControllerConnected( const uno::Reference< frame::XController >& xController ) +{ + try + { + if( !m_pControllers ) + return sal_False; + + uno::Sequence< uno::Reference<uno::XInterface> > aSeq = impl_getControllerContainer()->getElements(); + for( sal_Int32 nN = aSeq.getLength(); nN--; ) + { + if( aSeq[nN] == xController ) + return sal_True; + } + } + catch( uno::Exception ) + { + } + return sal_False; +} + + uno::Reference< frame::XController > ChartModel +::impl_getCurrentController() throw(uno::RuntimeException) +{ + //@todo? hold only weak references to controllers + + // get the last active controller of this model + if( m_xCurrentController.is() ) + return m_xCurrentController; + + // get the first controller of this model + if( m_pControllers && impl_getControllerContainer()->getLength() ) + { + uno::Reference<uno::XInterface> xI = impl_getControllerContainer()->getElements()[0]; + return uno::Reference<frame::XController>( xI, uno::UNO_QUERY ); + } + + //return nothing if no controllers are connected at all + return uno::Reference< frame::XController > (); +} + + void SAL_CALL ChartModel +::impl_notifyModifiedListeners() + throw( uno::RuntimeException) +{ + ::cppu::OInterfaceContainerHelper* pIC = m_aLifeTimeManager.m_aListenerContainer + .getContainer( ::getCppuType((const uno::Reference< util::XModifyListener >*)0) ); + if( pIC ) + { + lang::EventObject aEvent( static_cast< lang::XComponent*>(this) ); + ::cppu::OInterfaceIteratorHelper aIt( *pIC ); + while( aIt.hasMoreElements() ) + (static_cast< util::XModifyListener*>(aIt.next()))->modified( aEvent ); + } +} + +//----------------------------------------------------------------- +// lang::XServiceInfo +//----------------------------------------------------------------- + +APPHELPER_XSERVICEINFO_IMPL(ChartModel,CHART_MODEL_SERVICE_IMPLEMENTATION_NAME) + + uno::Sequence< rtl::OUString > ChartModel +::getSupportedServiceNames_Static() +{ + uno::Sequence< rtl::OUString > aSNS( 2 ); + aSNS.getArray()[ 0 ] = CHART_MODEL_SERVICE_NAME; + aSNS.getArray()[ 1 ] = ::rtl::OUString::createFromAscii("com.sun.star.document.OfficeDocument"); + //// @todo : add additional services if you support any further + return aSNS; +} + +//----------------------------------------------------------------- +// frame::XModel (required interface) +//----------------------------------------------------------------- + + sal_Bool SAL_CALL ChartModel +::attachResource( const ::rtl::OUString& rURL + , const uno::Sequence< beans::PropertyValue >& rMediaDescriptor ) + throw(uno::RuntimeException) +{ + /* + The method attachResource() is used by the frame loader implementations + to inform the model about its URL and MediaDescriptor. + */ + + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall()) + return sal_False; //behave passive if already disposed or closed or throw exception @todo? + //mutex is acquired + + if(m_aResource.getLength()!=0)//we have a resource already //@todo? or is setting a new resource allowed? + return sal_False; + m_aResource = rtl::OUString( rURL ); + m_aMediaDescriptor = rMediaDescriptor; + + //@todo ? check rURL ?? + //@todo ? evaluate m_aMediaDescriptor; + //@todo ? ... ??? --> nothing, this method is only for setting informations + + return sal_True; +} + + ::rtl::OUString SAL_CALL ChartModel +::getURL() throw(uno::RuntimeException) +{ + return impl_g_getLocation(); +} + + uno::Sequence< beans::PropertyValue > SAL_CALL ChartModel +::getArgs() throw(uno::RuntimeException) +{ + /* + The method getArgs() returns a sequence of property values + that report the resource description according to com.sun.star.document.MediaDescriptor, + specified on loading or saving with storeAsURL. + */ + + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall()) + return uno::Sequence< beans::PropertyValue >(); //behave passive if already disposed or closed or throw exception @todo? + //mutex is acquired + + return m_aMediaDescriptor; +} + + void SAL_CALL ChartModel +::connectController( const uno::Reference< frame::XController >& xController ) + throw(uno::RuntimeException) +{ + //@todo? this method is declared as oneway -> ...? + + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall()) + return ; //behave passive if already disposed or closed + //mutex is acquired + + //--add controller + impl_getControllerContainer()->addInterface(xController); +} + + void SAL_CALL ChartModel +::disconnectController( const uno::Reference< frame::XController >& xController ) + throw(uno::RuntimeException) +{ + //@todo? this method is declared as oneway -> ...? + + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall()) + return; //behave passive if already disposed or closed + + //--remove controller + impl_getControllerContainer()->removeInterface(xController); + + //case: current controller is disconnected: + if( m_xCurrentController == xController ) + m_xCurrentController = uno::Reference< frame::XController > (); +} + + void SAL_CALL ChartModel +::lockControllers() throw(uno::RuntimeException) +{ + /* + suspends some notifications to the controllers which are used for display updates. + + The calls to lockControllers() and unlockControllers() may be nested + and even overlapping, but they must be in pairs. While there is at least one lock + remaining, some notifications for display updates are not broadcasted. + */ + + //@todo? this method is declared as oneway -> ...? + + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall()) + return; //behave passive if already disposed or closed or throw exception @todo? + ++m_nControllerLockCount; +} + + void SAL_CALL ChartModel +::unlockControllers() throw(uno::RuntimeException) +{ + /* + resumes the notifications which were suspended by lockControllers() . + + The calls to lockControllers() and unlockControllers() may be nested + and even overlapping, but they must be in pairs. While there is at least one lock + remaining, some notifications for display updates are not broadcasted. + */ + + //@todo? this method is declared as oneway -> ...? + + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall()) + return; //behave passive if already disposed or closed or throw exception @todo? + --m_nControllerLockCount; +} + + sal_Bool SAL_CALL ChartModel +::hasControllersLocked() throw(uno::RuntimeException) +{ + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall()) + return sal_False; //behave passive if already disposed or closed or throw exception @todo? + return ( m_nControllerLockCount != 0 ) ; +} + + uno::Reference< frame::XController > SAL_CALL ChartModel +::getCurrentController() throw(uno::RuntimeException) +{ + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall()) + throw lang::DisposedException(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "getCurrentController was called on an already disposed or closed model" ) ) + , static_cast< ::cppu::OWeakObject* >(this)); + + return impl_getCurrentController(); +} + + void SAL_CALL ChartModel +::setCurrentController( const uno::Reference< frame::XController >& xController ) + throw(container::NoSuchElementException, uno::RuntimeException) +{ + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall()) + throw lang::DisposedException(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "setCurrentController was called on an already disposed or closed model" ) ) + , static_cast< ::cppu::OWeakObject* >(this)); + + //OSL_ENSURE( impl_isControllerConnected(xController), "setCurrentController is called with a Controller which is not connected" ); + if(!impl_isControllerConnected(xController)) + throw container::NoSuchElementException(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "setCurrentController is called with a Controller which is not connected" ) ) + , static_cast< ::cppu::OWeakObject* >(this)); + + m_xCurrentController = xController; +} + + uno::Reference< uno::XInterface > SAL_CALL ChartModel +::getCurrentSelection() throw(uno::RuntimeException) +{ + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall()) + throw lang::DisposedException(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "getCurrentSelection was called on an already disposed or closed model" ) ) + , static_cast< ::cppu::OWeakObject* >(this)); + + + uno::Reference< uno::XInterface > xReturn=NULL; + uno::Reference< frame::XController > xController = impl_getCurrentController(); + + aGuard.clear(); + if( xController.is() ) + { + uno::Reference< view::XSelectionSupplier > xSelectionSupl( xController, uno::UNO_QUERY ); + if ( xSelectionSupl.is() ) + { + uno::Any aSel = xSelectionSupl->getSelection(); + aSel >>= xReturn ; + } + } + return xReturn; +} + + +//----------------------------------------------------------------- +// lang::XComponent (base of XModel) +//----------------------------------------------------------------- + void SAL_CALL ChartModel +::dispose() throw(uno::RuntimeException) +{ + //This object should release all resources and references in the + //easiest possible manner + //This object must notify all registered listeners using the method + //<member>XEventListener::disposing</member> + + //hold no mutex + if( !m_aLifeTimeManager.dispose() ) + return; + + //--release all resources and references + //// @todo +} + + void SAL_CALL ChartModel +::addEventListener( const uno::Reference< lang::XEventListener > & xListener ) + throw(uno::RuntimeException) +{ + if( m_aLifeTimeManager.impl_isDisposedOrClosed() ) + return; //behave passive if already disposed or closed + + m_aLifeTimeManager.m_aListenerContainer.addInterface( ::getCppuType((const uno::Reference< util::XCloseListener >*)0), xListener ); +} + + void SAL_CALL ChartModel +::removeEventListener( const uno::Reference< lang::XEventListener > & xListener ) + throw(uno::RuntimeException) +{ + if( m_aLifeTimeManager.impl_isDisposedOrClosed() ) + return; //behave passive if already disposed or closed + + m_aLifeTimeManager.m_aListenerContainer.removeInterface( ::getCppuType((const uno::Reference< util::XCloseListener >*)0), xListener ); + return; +} + +//----------------------------------------------------------------- +// util::XCloseBroadcaster (base of XCloseable) +//----------------------------------------------------------------- + void SAL_CALL ChartModel +::addCloseListener( const uno::Reference< util::XCloseListener > & xListener ) + throw(uno::RuntimeException) +{ + m_aLifeTimeManager.g_addCloseListener( xListener ); +} + + void SAL_CALL ChartModel +::removeCloseListener( const uno::Reference< util::XCloseListener > & xListener ) + throw(uno::RuntimeException) +{ + if( m_aLifeTimeManager.impl_isDisposedOrClosed() ) + return; //behave passive if already disposed or closed + + m_aLifeTimeManager.m_aListenerContainer.removeInterface( ::getCppuType((const uno::Reference< util::XCloseListener >*)0), xListener ); + return; +} + +//----------------------------------------------------------------- +// util::XCloseable +//----------------------------------------------------------------- + void SAL_CALL ChartModel +::close( sal_Bool bDeliverOwnership ) + throw( util::CloseVetoException ) +{ + //hold no mutex + + if( !m_aLifeTimeManager.g_close_startTryClose( bDeliverOwnership ) ) + return; + //no mutex is acquired + + // At the end of this method may we must dispose ourself ... + // and may nobody from outside hold a reference to us ... + // then it's a good idea to do that by ourself. + uno::Reference< uno::XInterface > xSelfHold( static_cast< ::cppu::OWeakObject* >(this) ); + + //the listeners have had no veto + //check wether we self can close + { + util::CloseVetoException aVetoException = util::CloseVetoException( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "the model itself could not be closed" ) ) + , static_cast< ::cppu::OWeakObject* >(this)); + + if( m_aLifeTimeManager.g_close_isNeedToCancelLongLastingCalls( bDeliverOwnership, aVetoException) ) + { + ////you can empty this block, if you never start longlasting calls or + ////if your longlasting calls are per default not cancelable (check how you have constructed your LifeTimeManager) + + sal_Bool bLongLastingCallsAreCanceled = sal_False; + try + { + //try to cancel running longlasting calls + //// @todo + } + catch( uno::Exception ) + { + //// @todo + //do not throw anything here!! (without endTryClose) + } + //if not successful canceled + if(!bLongLastingCallsAreCanceled) + { + m_aLifeTimeManager.g_close_endTryClose(bDeliverOwnership, sal_True, aVetoException); + //the exception is thrown in the above method + } + } + + } + m_aLifeTimeManager.g_close_endTryClose_doClose(); +} + +//----------------------------------------------------------------- +// frame::XStorable (required interface) +//----------------------------------------------------------------- + sal_Bool SAL_CALL ChartModel +::hasLocation() throw(uno::RuntimeException) +{ + //@todo guard + return m_aResource.getLength()!=0; +} + + ::rtl::OUString SAL_CALL ChartModel +::getLocation() throw(uno::RuntimeException) +{ + return impl_g_getLocation(); +} + + sal_Bool SAL_CALL ChartModel +::isReadonly() throw(uno::RuntimeException) +{ + //@todo guard + return m_bReadOnly; +} + + void SAL_CALL ChartModel +::store() throw(io::IOException, uno::RuntimeException) +{ + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall(sal_True)) //start LongLastingCall + return; //behave passive if already disposed or closed or throw exception @todo? + + ::rtl::OUString aLocation = m_aResource; + + if( aLocation.getLength() == 0 ) + throw io::IOException(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "no location specified" ) ) + , static_cast< ::cppu::OWeakObject* >(this)); + //@todo check wether aLocation is something like private:factory... + if( m_bReadOnly ) + throw io::IOException(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "document is read only" ) ) + , static_cast< ::cppu::OWeakObject* >(this)); + + m_bModified = sal_False; + aGuard.clear(); + + //@todo store +} + + void SAL_CALL ChartModel +::storeAsURL( const ::rtl::OUString& rURL + , const uno::Sequence< beans::PropertyValue >& rMediaDescriptor ) + throw(io::IOException, uno::RuntimeException) +{ + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall(sal_True)) //start LongLastingCall + return; //behave passive if already disposed or closed or throw exception @todo? + + apphelper::MediaDescriptorHelper aMediaDescriptorHelper(rMediaDescriptor); + m_aMediaDescriptor = aMediaDescriptorHelper.getReducedForModel(); + m_aResource = rURL; + + m_bReadOnly = sal_False; + m_bModified = sal_False; + aGuard.clear(); + + //@todo saveTo(rURL) +} + + void SAL_CALL ChartModel +::storeToURL( const ::rtl::OUString& rURL + , const uno::Sequence< beans::PropertyValue >& rMediaDescriptor ) + throw(io::IOException, uno::RuntimeException) +{ + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall(sal_True)) //start LongLastingCall + return; //behave passive if already disposed or closed or throw exception @todo? + //do not change the internal state of the document here + //... + + aGuard.clear(); + //@todo saveTo(rURL) +} + +//----------------------------------------------------------------- +// util::XModifiable (required interface) +//----------------------------------------------------------------- + sal_Bool SAL_CALL ChartModel +::isModified() throw(uno::RuntimeException) +{ + //@todo guard + return m_bModified; +} + + void SAL_CALL ChartModel +::setModified( sal_Bool bModified ) + throw(beans::PropertyVetoException, uno::RuntimeException) +{ + LifeTimeGuard aGuard(m_aLifeTimeManager); + if(!aGuard.startApiCall())//@todo ? is this a long lasting call?? + return; //behave passive if already disposed or closed or throw exception @todo? + m_bModified = bModified; + aGuard.clear(); + + if(bModified) + impl_notifyModifiedListeners(); +} + +//----------------------------------------------------------------- +// util::XModifyBroadcaster (base of XModifiable) +//----------------------------------------------------------------- + void SAL_CALL ChartModel +::addModifyListener( const uno::Reference< util::XModifyListener >& xListener ) + throw(uno::RuntimeException) +{ + if( m_aLifeTimeManager.impl_isDisposedOrClosed() ) + return; //behave passive if already disposed or closed + + m_aLifeTimeManager.m_aListenerContainer.addInterface( ::getCppuType((const uno::Reference< util::XModifyListener >*)0), xListener ); +} + + void SAL_CALL ChartModel +::removeModifyListener( const uno::Reference< util::XModifyListener >& xListener ) + throw(uno::RuntimeException) +{ + if( m_aLifeTimeManager.impl_isDisposedOrClosed() ) + return; //behave passive if already disposed or closed + + m_aLifeTimeManager.m_aListenerContainer.removeInterface( ::getCppuType((const uno::Reference< util::XModifyListener >*)0), xListener ); +} +/* +//----------------------------------------------------------------- +// view::XPrintable (optional interface) +//----------------------------------------------------------------- + uno::Sequence< beans::PropertyValue > SAL_CALL ChartModel +::getPrinter() throw(uno::RuntimeException) +{ + //@todo guard + return m_aPrinterOptions; +} + + void SAL_CALL ChartModel +::setPrinter( const uno::Sequence< beans::PropertyValue >& rPrinter ) + throw(lang::IllegalArgumentException, uno::RuntimeException) +{ + //@todo guard + m_aPrinterOptions = rPrinter; +} + + void SAL_CALL ChartModel +::print( const uno::Sequence< beans::PropertyValue >& rOptions ) + throw(lang::IllegalArgumentException, uno::RuntimeException) +{ + //@todo +} + +//----------------------------------------------------------------- +// document::XEventBroadcaster (optional interface) +//----------------------------------------------------------------- + + void SAL_CALL ChartModel +::addEventListener( const uno::Reference< document::XEventListener >& xListener ) + throw(uno::RuntimeException) +{ + //@todo +} + + void SAL_CALL ChartModel +::removeEventListener( const uno::Reference< document::XEventListener >& xListener ) + throw(uno::RuntimeException) +{ + //@todo +} + +//----------------------------------------------------------------- +// document::XEventsSupplier (optional interface) +//----------------------------------------------------------------- + + uno::Reference< container::XNameReplace > SAL_CALL ChartModel +::getEvents() throw(uno::RuntimeException) +{ + //@todo +} + +//----------------------------------------------------------------- +// document::XDocumentInfoSupplier (optional interface) +//----------------------------------------------------------------- + + uno::Reference< document::XDocumentInfo > SAL_CALL ChartModel +::getDocumentInfo() throw(uno::RuntimeException) +{ + //@todo +} + +//----------------------------------------------------------------- +// document::XViewDataSupplier (optional interface) +//----------------------------------------------------------------- + + uno::Reference< container::XIndexAccess > SAL_CALL ChartModel +::getViewData() throw(uno::RuntimeException) +{ + //@todo +} + + void SAL_CALL ChartModel +::setViewData( const uno::Reference< container::XIndexAccess >& xData ) + throw(uno::RuntimeException) +{ + //m_bModified = sal_True;//@todo? is this really correct + //@todo +} +*/ + +//----------------------------------------------------------------- +// ::com::sun::star::style::XStyleFamiliesSupplier +//----------------------------------------------------------------- +::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess > SAL_CALL ChartModel + ::getStyleFamilies() + throw (uno::RuntimeException) +{ + OSL_ASSERT( m_pImplChartModel.get() != 0 ); + // /-- + MutexGuard aGuard( m_aModelMutex ); + return m_pImplChartModel->GetStyleFamilies(); + // \-- +} + +//----------------------------------------------------------------- +// chart2::XModelDataProvider +//----------------------------------------------------------------- +// Sequence< Reference< chart2::XDataSeries > > SAL_CALL ChartModel +// ::getDataSeries() +// throw (uno::RuntimeException) +// { +// OSL_ASSERT( m_pImplChartModel.get() != 0 ); +// // /-- +// MutexGuard aGuard( m_aModelMutex ); +// return m_pImplChartModel->GetDataSeries(); +// // \-- +// } + +//----------------------------------------------------------------- +// chart2::XChartDocument +//----------------------------------------------------------------- + + uno::Reference< chart2::XDiagram > SAL_CALL ChartModel +::getDiagram() + throw (uno::RuntimeException) +{ + OSL_ASSERT( m_pImplChartModel.get() != 0 ); + // /-- + MutexGuard aGuard( m_aModelMutex ); + try + { + return m_pImplChartModel->GetDiagram( 0 ); + } + catch( container::NoSuchElementException ) + { + } + + return uno::Reference< chart2::XDiagram >(); + // \-- +} + + void SAL_CALL ChartModel +::setDiagram( const uno::Reference< chart2::XDiagram >& xDiagram ) + throw (lang::IllegalArgumentException, + uno::RuntimeException) +{ + OSL_ASSERT( m_pImplChartModel.get() != 0 ); + // /-- + MutexGuard aGuard( m_aModelMutex ); + m_pImplChartModel->RemoveAllDiagrams(); + m_pImplChartModel->AppendDiagram( xDiagram ); + // \-- +} + + void SAL_CALL ChartModel +::attachDataProvider( const uno::Reference< chart2::XDataProvider >& xProvider ) + throw (uno::RuntimeException) +{ + OSL_ASSERT( m_pImplChartModel.get() != 0 ); + // /-- + MutexGuard aGuard( m_aModelMutex ); + m_pImplChartModel->SetDataProvider( xProvider ); + // \-- +} + + void SAL_CALL ChartModel +::setRangeRepresentation( const ::rtl::OUString& aRangeRepresentation ) + throw (lang::IllegalArgumentException, + uno::RuntimeException) +{ + OSL_ASSERT( m_pImplChartModel.get() != 0 ); + // /-- + MutexGuard aGuard( m_aModelMutex ); + m_pImplChartModel->SetRangeRepresentation( aRangeRepresentation ); + // \-- +} + + void SAL_CALL ChartModel +::setChartTypeManager( const uno::Reference< chart2::XChartTypeManager >& xNewManager ) + throw (uno::RuntimeException) +{ + OSL_ASSERT( m_pImplChartModel.get() != 0 ); + // /-- + MutexGuard aGuard( m_aModelMutex ); + m_pImplChartModel->SetChartTypeManager( xNewManager ); + // \-- +} + + uno::Reference< chart2::XChartTypeManager > SAL_CALL ChartModel +::getChartTypeManager() + throw (uno::RuntimeException) +{ + OSL_ASSERT( m_pImplChartModel.get() != 0 ); + // /-- + MutexGuard aGuard( m_aModelMutex ); + return m_pImplChartModel->GetChartTypeManager(); + // \-- +} + + void SAL_CALL ChartModel +::setChartTypeTemplate( const uno::Reference< chart2::XChartTypeTemplate >& xNewTemplate ) + throw (uno::RuntimeException) +{ + OSL_ASSERT( m_pImplChartModel.get() != 0 ); + // /-- + MutexGuard aGuard( m_aModelMutex ); + m_pImplChartModel->SetChartTypeTemplate( xNewTemplate ); + // \-- +} + + uno::Reference< chart2::XChartTypeTemplate > SAL_CALL ChartModel +::getChartTypeTemplate() + throw (uno::RuntimeException) +{ + OSL_ASSERT( m_pImplChartModel.get() != 0 ); + // /-- + MutexGuard aGuard( m_aModelMutex ); + return m_pImplChartModel->GetChartTypeTemplate(); + // \-- +} + +// void SAL_CALL ChartModel +// ::setSplitLayoutContainer( const uno::Reference< layout::XSplitLayoutContainer >& xLayoutCnt ) +// throw (uno::RuntimeException) +// { +// OSL_ASSERT( m_pImplChartModel.get() != 0 ); +// // /-- +// MutexGuard aGuard( m_aModelMutex ); +// m_pImplChartModel->SetSplitLayoutContainer( xLayoutCnt ); +// // \-- +// } + +// uno::Reference< layout::XSplitLayoutContainer > SAL_CALL ChartModel +// ::getSplitLayoutContainer() +// throw (uno::RuntimeException) +// { +// OSL_ASSERT( m_pImplChartModel.get() != 0 ); +// // /-- +// MutexGuard aGuard( m_aModelMutex ); +// return m_pImplChartModel->GetSplitLayoutContainer(); +// // \-- +// } + + + +// ____ XTitled ____ +uno::Reference< chart2::XTitle > SAL_CALL ChartModel::getTitle() + throw (uno::RuntimeException) +{ + OSL_ASSERT( m_pImplChartModel.get() != 0 ); + // /-- + MutexGuard aGuard( m_aModelMutex ); + return m_pImplChartModel->GetTitle(); + // \-- +} + +void SAL_CALL ChartModel::setTitle( + const uno::Reference< + chart2::XTitle >& Title ) + throw (uno::RuntimeException) +{ + OSL_ASSERT( m_pImplChartModel.get() != 0 ); + // /-- + MutexGuard aGuard( m_aModelMutex ); + m_pImplChartModel->SetTitle( Title ); + // \-- +} + +// ____ XInterface (for old API wrapper) ____ +uno::Any SAL_CALL ChartModel::queryInterface( const uno::Type& aType ) + throw (uno::RuntimeException) +{ + // return old API wrapper + if( aType == + ::getCppuType( (uno::Reference< ::com::sun::star::chart::XChartDocument > *)0 )) + { + return uno::makeAny( m_pImplChartModel->GetOldChartDocument( this )); + } + + return impl::ChartModel_Base::queryInterface( aType ); +} + + +} // namespace chart diff --git a/chart2/source/model/main/ChartModel.hxx b/chart2/source/model/main/ChartModel.hxx new file mode 100644 index 000000000000..78ee23bec9bc --- /dev/null +++ b/chart2/source/model/main/ChartModel.hxx @@ -0,0 +1,518 @@ +/************************************************************************* + * + * $RCSfile: ChartModel.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART_MODEL_HXX +#define _CHART_MODEL_HXX + +#include "LifeTime.hxx" +#include "ServiceMacros.hxx" + +#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_ +#include <com/sun/star/frame/XModel.hpp> +#endif +#ifndef _COM_SUN_STAR_FRAME_XSTORABLE_HPP_ +#include <com/sun/star/frame/XStorable.hpp> +#endif +#ifndef _COM_SUN_STAR_UTIL_XMODIFIABLE_HPP_ +#include <com/sun/star/util/XModifiable.hpp> +#endif +/* +#ifndef _COM_SUN_STAR_SDBC_XCLOSEABLE_HPP_ +#include <com/sun/star/util/XCloseable.hpp> +#endif +*/ +#ifndef _COM_SUN_STAR_VIEW_XPRINTABLE_HPP_ +#include <com/sun/star/view/XPrintable.hpp> +#endif +#ifndef _COM_SUN_STAR_DOCUMENT_XEVENTBROADCASTER_HPP_ +#include <com/sun/star/document/XEventBroadcaster.hpp> +#endif +#ifndef _COM_SUN_STAR_DOCUMENT_XEVENTSSUPPLIER_HPP_ +#include <com/sun/star/document/XEventsSupplier.hpp> +#endif +#ifndef _COM_SUN_STAR_DOCUMENT_XDOCUMENTINFOSUPPLIER_HPP_ +#include <com/sun/star/document/XDocumentInfoSupplier.hpp> +#endif +#ifndef _COM_SUN_STAR_DOCUMENT_XVIEWDATASUPPLIER_HPP_ +#include <com/sun/star/document/XViewDataSupplier.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif +#ifndef _COM_SUN_STAR_STYLE_XSTYLEFAMILIESSUPPLIER_HPP_ +#include <com/sun/star/style/XStyleFamiliesSupplier.hpp> +#endif + +// #ifndef _DRAFTS_COM_SUN_STAR_CHART2_XMODELDATAPROVIDER_HPP_ +// #include <drafts/com/sun/star/chart2/XModelDataProvider.hpp> +// #endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTDOCUMENT_HPP_ +#include <drafts/com/sun/star/chart2/XChartDocument.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTITLED_HPP_ +#include <drafts/com/sun/star/chart2/XTitled.hpp> +#endif + +/* +#ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_ +#include <com/sun/star/frame/XController.hpp> +#endif +#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_ +#include <com/sun/star/frame/XDispatchProvider.hpp> +#endif +#ifndef _COM_SUN_STAR_VIEW_XSELECTIONSUPPLIER_HPP_ +#include <com/sun/star/view/XSelectionSupplier.hpp> +#endif +#ifndef _COM_SUN_STAR_UI_XCONTEXTMENUINTERCEPTION_HPP_ +#include <com/sun/star/ui/XContextMenuInterception.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XWEAK_HPP_ +#include <com/sun/star/uno/XWeak.hpp> +#endif +#ifndef _COM_SUN_STAR_SDBC_XCLOSELISTENER_HPP_ +#include <com/sun/star/util/XCloseListener.hpp> +#endif + +*/ +/* +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_ +#include <com/sun/star/beans/XPropertyChangeListener.hpp> +#endif +#ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_ +#include <com/sun/star/frame/XDispatch.hpp> +#endif +#ifndef _COM_SUN_STAR_FORM_XLOADABLE_HPP_ +#include <com/sun/star/form/XLoadable.hpp> +#endif +*/ +#ifndef _CPPUHELPER_IMPLBASE7_HXX_ +#include <cppuhelper/implbase7.hxx> +#endif + +// for auto_ptr +#include <memory> + +//============================================================================= +/** this is an example implementation for the service ::com::sun::star::document::OfficeDocument +*/ + +namespace chart +{ + +namespace impl +{ + class ImplChartModel; + +// Note: needed for queryInterface (if it calls the base-class implementation) +typedef ::cppu::WeakImplHelper7 < +// ::com::sun::star::frame::XModel //comprehends XComponent (required interface), base of XChartDocument + ::com::sun::star::util::XCloseable //comprehends XCloseBroadcaster + ,::com::sun::star::frame::XStorable //(required interface) + ,::com::sun::star::util::XModifiable //comprehends XModifyBroadcaster (required interface) +// ,::com::sun::star::view::XPrintable //(optional interface) +// ,::com::sun::star::document::XEventBroadcaster //(optional interface) +// ,::com::sun::star::document::XEventsSupplier //(optional interface) +// ,::com::sun::star::document::XDocumentInfoSupplier //(optional interface) +// ,::com::sun::star::document::XViewDataSupplier //(optional interface) + + // ,::com::sun::star::uno::XWeak // implemented by WeakImplHelper(optional interface) + // ,::com::sun::star::uno::XInterface // implemented by WeakImplHelper(optional interface) + // ,::com::sun::star::lang::XTypeProvider // implemented by WeakImplHelper + ,::com::sun::star::lang::XServiceInfo +// ,::drafts::com::sun::star::chart2::XModelDataProvider + ,::drafts::com::sun::star::chart2::XChartDocument // derived from XModel + ,::com::sun::star::style::XStyleFamiliesSupplier + ,::drafts::com::sun::star::chart2::XTitled + > + ChartModel_Base; +} + +class ChartModel : public impl::ChartModel_Base +{ + +private: + mutable ::apphelper::CloseableLifeTimeManager m_aLifeTimeManager; + + mutable ::osl::Mutex m_aModelMutex; + sal_Bool volatile m_bReadOnly; + sal_Bool volatile m_bModified; + + ::rtl::OUString m_aResource; + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aMediaDescriptor; + + ::cppu::OInterfaceContainerHelper* volatile m_pControllers; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > m_xCurrentController; + sal_uInt16 m_nControllerLockCount; + +// ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aPrinterOptions; + + ::std::auto_ptr< impl::ImplChartModel > m_pImplChartModel; + +private: + //private methods + + ::rtl::OUString impl_g_getLocation(); + + ::cppu::OInterfaceContainerHelper* + impl_getControllerContainer() + throw (::com::sun::star::uno::RuntimeException); + + sal_Bool + impl_isControllerConnected( const com::sun::star::uno::Reference< + com::sun::star::frame::XController >& xController ); + + com::sun::star::uno::Reference< com::sun::star::frame::XController > + impl_getCurrentController() + throw( com::sun::star::uno::RuntimeException); + + void SAL_CALL + impl_notifyModifiedListeners() + throw( com::sun::star::uno::RuntimeException); + +public: + //no default constructor + ChartModel(::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext); + virtual ~ChartModel(); + + //----------------------------------------------------------------- + // ::com::sun::star::lang::XServiceInfo + //----------------------------------------------------------------- + + APPHELPER_XSERVICEINFO_DECL() + APPHELPER_SERVICE_FACTORY_HELPER(ChartModel) + + //----------------------------------------------------------------- + // ::com::sun::star::frame::XModel (required interface) + //----------------------------------------------------------------- + + virtual sal_Bool SAL_CALL + attachResource( const ::rtl::OUString& rURL + , const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rMediaDescriptor ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::rtl::OUString SAL_CALL + getURL() throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL + getArgs() throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + connectController( const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XController >& xController ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + disconnectController( const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XController >& xController ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + lockControllers() throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + unlockControllers() throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL + hasControllersLocked() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > SAL_CALL + getCurrentController() + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + setCurrentController( const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XController >& xController ) + throw (::com::sun::star::container::NoSuchElementException + , ::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL + getCurrentSelection() + throw (::com::sun::star::uno::RuntimeException); + + + //----------------------------------------------------------------- + // ::com::sun::star::lang::XComponent (base of XModel) + //----------------------------------------------------------------- + virtual void SAL_CALL + dispose() throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + addEventListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + removeEventListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener ) + throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::util::XCloseable + //----------------------------------------------------------------- + virtual void SAL_CALL + close( sal_Bool bDeliverOwnership ) + throw( ::com::sun::star::util::CloseVetoException ); + + //----------------------------------------------------------------- + // ::com::sun::star::util::XCloseBroadcaster (base of XCloseable) + //----------------------------------------------------------------- + virtual void SAL_CALL + addCloseListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::util::XCloseListener > & xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + removeCloseListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::util::XCloseListener > & xListener ) + throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::frame::XStorable (required interface) + //----------------------------------------------------------------- + virtual sal_Bool SAL_CALL + hasLocation() throw (::com::sun::star::uno::RuntimeException); + + virtual ::rtl::OUString SAL_CALL + getLocation() throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL + isReadonly() throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + store() throw (::com::sun::star::io::IOException + , ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + storeAsURL( const ::rtl::OUString& rURL + , const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rMediaDescriptor ) + throw (::com::sun::star::io::IOException + , ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + storeToURL( const ::rtl::OUString& rURL + , const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rMediaDescriptor ) + throw (::com::sun::star::io::IOException + , ::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::util::XModifiable (required interface) + //----------------------------------------------------------------- + virtual sal_Bool SAL_CALL + isModified() throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + setModified( sal_Bool bModified ) + throw (::com::sun::star::beans::PropertyVetoException + , ::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::util::XModifyBroadcaster (base of XModifiable) + //----------------------------------------------------------------- + virtual void SAL_CALL + addModifyListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::util::XModifyListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + removeModifyListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::util::XModifyListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); +/* + //----------------------------------------------------------------- + // ::com::sun::star::view::XPrintable (optional interface) + //----------------------------------------------------------------- + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL + getPrinter() throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + setPrinter( const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rPrinter ) + throw (::com::sun::star::lang::IllegalArgumentException + , ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + print( const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rOptions ) + throw (::com::sun::star::lang::IllegalArgumentException + , ::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::document::XEventBroadcaster (optional interface) + //----------------------------------------------------------------- + + virtual void SAL_CALL + addEventListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::document::XEventListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + removeEventListener( const ::com::sun::star::uno::Reference< + ::com::sun::star::document::XEventListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::document::XEventsSupplier (optional interface) + //----------------------------------------------------------------- + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL + getEvents() throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::document::XDocumentInfoSupplier (optional interface) + //----------------------------------------------------------------- + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentInfo > SAL_CALL + getDocumentInfo() throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::com::sun::star::document::XViewDataSupplier (optional interface) + //----------------------------------------------------------------- + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL + getViewData() throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + setViewData( const ::com::sun::star::uno::Reference< + ::com::sun::star::container::XIndexAccess >& xData ) + throw (::com::sun::star::uno::RuntimeException); + */ + + //----------------------------------------------------------------- + // ::com::sun::star::style::XStyleFamiliesSupplier + //----------------------------------------------------------------- + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess > SAL_CALL + getStyleFamilies() throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::drafts::com::sun::star::chart2::XModelDataProvider + //----------------------------------------------------------------- +// virtual ::com::sun::star::uno::Sequence< +// ::com::sun::star::uno::Reference< +// ::drafts::com::sun::star::chart2::XDataSeries > > SAL_CALL +// getDataSeries() throw (::com::sun::star::uno::RuntimeException); + + //----------------------------------------------------------------- + // ::drafts::com::sun::star::chart2::XChartDocument + //----------------------------------------------------------------- + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDiagram > SAL_CALL + getDiagram() throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + setDiagram( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDiagram >& xDiagram ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + attachDataProvider( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataProvider >& xProvider ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + setRangeRepresentation( const ::rtl::OUString& aRangeRepresentation ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + setChartTypeManager( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartTypeManager >& xNewManager ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XChartTypeManager > SAL_CALL + getChartTypeManager() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL + setChartTypeTemplate( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartTypeTemplate >& xNewTemplate ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XChartTypeTemplate > SAL_CALL + getChartTypeTemplate() + throw (::com::sun::star::uno::RuntimeException); +// virtual void SAL_CALL setSplitLayoutContainer( +// const ::com::sun::star::uno::Reference< +// ::drafts::com::sun::star::layout::XSplitLayoutContainer >& xLayoutCnt ) +// throw (::com::sun::star::uno::RuntimeException); +// virtual ::com::sun::star::uno::Reference< +// ::drafts::com::sun::star::layout::XSplitLayoutContainer > SAL_CALL getSplitLayoutContainer() +// throw (::com::sun::star::uno::RuntimeException); + + // ____ XTitled ____ + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XTitle > SAL_CALL getTitle() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTitle( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XTitle >& Title ) + throw (::com::sun::star::uno::RuntimeException); + + // ____ XInterface (for old API wrapper) ____ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) + throw (::com::sun::star::uno::RuntimeException); +}; + +} // namespace chart + +#endif + diff --git a/chart2/source/model/main/DataPoint.cxx b/chart2/source/model/main/DataPoint.cxx new file mode 100644 index 000000000000..784e5078d009 --- /dev/null +++ b/chart2/source/model/main/DataPoint.cxx @@ -0,0 +1,217 @@ +/************************************************************************* + * + * $RCSfile: DataPoint.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "DataPoint.hxx" +#include "DataPointProperties.hxx" +#include "CharacterProperties.hxx" +#include "UserDefinedProperties.hxx" +#include "PropertyHelper.hxx" +#include "macros.hxx" +#include "algohelper.hxx" + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif +#ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_ +#include <com/sun/star/style/XStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif + +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ +#include <com/sun/star/uno/Sequence.hxx> +#endif + +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::beans::Property; +using ::osl::MutexGuard; + +// ____________________________________________________________ + +namespace +{ +const uno::Sequence< Property > & lcl_GetPropertySequence() +{ + static uno::Sequence< Property > aPropSeq; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + ::chart::DataPointProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ true ); + ::chart::CharacterProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ true ); + ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::helper::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::helper::VectorToSequence( aProperties ); + } + + return aPropSeq; +} +} // anonymous namespace + +// ____________________________________________________________ + +namespace chart +{ + +DataPoint::DataPoint( ::osl::Mutex & _rMutex ) : + ::property::OPropertySet( _rMutex ), + m_rMutex( _rMutex ) +{} + +DataPoint::DataPoint( ::osl::Mutex & _rMutex, + const uno::Reference< + beans::XPropertySet > & rParentProperties ) : + ::property::OPropertySet( _rMutex ), + m_rMutex( _rMutex ), + m_xParentProperties( rParentProperties ) +{} + +DataPoint::~DataPoint() +{} + +// ____ XInterface ____ +uno::Any SAL_CALL DataPoint::queryInterface( + const uno::Type & rType ) + throw (uno::RuntimeException) +{ + // OPropertySet interfaces + uno::Any aAny = ::property::OPropertySet::queryInterface( rType ); + if( aAny.hasValue() ) + return aAny; + + // OWeakObject interfaces + return ::cppu::OWeakObject::queryInterface( rType ); +} + +void SAL_CALL DataPoint::acquire() throw () +{ + ::cppu::OWeakObject::acquire(); +} + +void SAL_CALL DataPoint::release() throw () +{ + ::cppu::OWeakObject::release(); +} + +// ____ OPropertySet ____ +uno::Any DataPoint::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + // the value set at the data series is the default + uno::Reference< beans::XFastPropertySet > xFast( m_xParentProperties, uno::UNO_QUERY ); + OSL_ASSERT( xFast.is()); + return xFast->getFastPropertyValue( nHandle ); +} + +::cppu::IPropertyArrayHelper & SAL_CALL DataPoint::getInfoHelper() +{ + return getInfoHelperConst(); +} + +::cppu::IPropertyArrayHelper & SAL_CALL DataPoint::getInfoHelperConst() const +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( + lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + +// ____ XPropertySet ____ +Reference< beans::XPropertySetInfo > SAL_CALL + DataPoint::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static Reference< beans::XPropertySetInfo > xInfo; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +::osl::Mutex & DataPoint::GetMutex() +{ + return m_rMutex; +} + +} // namespace chart diff --git a/chart2/source/model/main/DataPoint.hxx b/chart2/source/model/main/DataPoint.hxx new file mode 100644 index 000000000000..f89ddc5dfd0a --- /dev/null +++ b/chart2/source/model/main/DataPoint.hxx @@ -0,0 +1,121 @@ +/************************************************************************* + * + * $RCSfile: DataPoint.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_DATAPOINT_HXX +#define CHART_DATAPOINT_HXX + +#ifndef _CPPUHELPER_WEAK_HXX_ +#include <cppuhelper/weak.hxx> +#endif +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif + +#include "OPropertySet.hxx" + +namespace chart +{ + +class DataPoint : + public ::cppu::OWeakObject, + public ::property::OPropertySet +{ +public: + explicit DataPoint( ::osl::Mutex & _rMutex ); + DataPoint( ::osl::Mutex & _rMutex, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rParentProperties ); + virtual ~DataPoint(); + + // ____ XInterface ____ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type & rType ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() throw (); + virtual void SAL_CALL release() throw (); + +protected: + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + + ::osl::Mutex & GetMutex(); + + /** const variant of getInfoHelper() + */ + ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelperConst() const; + +private: + ::osl::Mutex & m_rMutex; + ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > m_xParentProperties; +}; + +} // namespace chart + +// CHART_DATAPOINT_HXX +#endif diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx new file mode 100644 index 000000000000..9881da9b803a --- /dev/null +++ b/chart2/source/model/main/DataPointProperties.cxx @@ -0,0 +1,365 @@ +/************************************************************************* + * + * $RCSfile: DataPointProperties.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "DataPointProperties.hxx" +#include "macros.hxx" + +#ifndef _COM_SUN_STAR_AWT_GRADIENT_HPP_ +#include <com/sun/star/awt/Gradient.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_FILLSTYLE_HPP_ +#include <com/sun/star/drawing/FillStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_LINESTYLE_HPP_ +#include <com/sun/star/drawing/LineStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_LINEDASH_HPP_ +#include <com/sun/star/drawing/LineDash.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_POLYPOLYGONBEZIERCOORDS_HPP_ +#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_HATCH_HPP_ +#include <com/sun/star/drawing/Hatch.hpp> +#endif +#ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_ +#include <com/sun/star/style/XStyle.hpp> +#endif + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_FILLBITMAP_HPP_ +#include <drafts/com/sun/star/chart2/FillBitmap.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_TRANSPARENCYSTYLE_HPP_ +#include <drafts/com/sun/star/chart2/TransparencyStyle.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_DATACAPTIONSTYLE_HPP_ +#include <drafts/com/sun/star/chart2/DataCaptionStyle.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_NUMBERFORMAT_HPP_ +#include <drafts/com/sun/star/chart2/NumberFormat.hpp> +#endif + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +using ::com::sun::star::beans::Property; + +namespace chart +{ + +void DataPointProperties::AddPropertiesToVector( + ::std::vector< Property > & rOutProperties, + bool bIncludeStyleProperties /* = false */ ) +{ + if( bIncludeStyleProperties ) + { + rOutProperties.push_back( + Property( C2U( "Style" ), + PROP_DATAPOINT_STYLE, + ::getCppuType( reinterpret_cast< const uno::Reference< ::com::sun::star::style::XStyle > * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEVOID )); + } + + // DataPointProperties + // =================== + + // Common + // ------ + rOutProperties.push_back( + Property( C2U( "Color" ), + PROP_DATAPOINT_COLOR, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEVOID // "maybe auto" + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "Transparency" ), + PROP_DATAPOINT_TRANSPARENCY, + ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + // Fill Properties + // --------------- + rOutProperties.push_back( + Property( C2U( "FillStyle" ), + PROP_DATAPOINT_FILL_STYLE, + ::getCppuType( reinterpret_cast< const drawing::FillStyle * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "TransparencyStyle" ), + PROP_DATAPOINT_TRANSPARENCY_STYLE, + ::getCppuType( reinterpret_cast< const chart2::TransparencyStyle * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT + | beans::PropertyAttribute::MAYBEVOID )); + + rOutProperties.push_back( + Property( C2U( "TransparencyGradient" ), + PROP_DATAPOINT_TRANSPARENCY_GRADIENT, + ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT + | beans::PropertyAttribute::MAYBEVOID )); + + rOutProperties.push_back( + Property( C2U( "Gradient" ), + PROP_DATAPOINT_GRADIENT, + ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT + | beans::PropertyAttribute::MAYBEVOID )); + + rOutProperties.push_back( + Property( C2U( "Hatch" ), + PROP_DATAPOINT_HATCH, + ::getCppuType( reinterpret_cast< const drawing::Hatch * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT + | beans::PropertyAttribute::MAYBEVOID )); + + rOutProperties.push_back( + Property( C2U( "Bitmap" ), + PROP_DATAPOINT_BITMAP, + ::getCppuType( reinterpret_cast< const chart2::FillBitmap * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT + | beans::PropertyAttribute::MAYBEVOID )); + + // border for filled objects + rOutProperties.push_back( + Property( C2U( "BorderColor" ), + PROP_DATAPOINT_BORDER_COLOR, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEVOID // "maybe auto" + | beans::PropertyAttribute::MAYBEDEFAULT )); + rOutProperties.push_back( + Property( C2U( "BorderStyle" ), + PROP_DATAPOINT_BORDER_STYLE, + ::getCppuType( reinterpret_cast< const drawing::LineStyle * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + rOutProperties.push_back( + Property( C2U( "BorderWidth" ), + PROP_DATAPOINT_BORDER_WIDTH, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + rOutProperties.push_back( + Property( C2U( "BorderDash" ), + PROP_DATAPOINT_BORDER_DASH, + ::getCppuType( reinterpret_cast< const drawing::LineDash * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEVOID )); + rOutProperties.push_back( + Property( C2U( "BorderTransparency" ), + PROP_DATAPOINT_BORDER_TRANSPARENCY, + ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEVOID )); + + // Line Properties + // --------------- + rOutProperties.push_back( + Property( C2U( "LineStyle" ), + PROP_DATAPOINT_LINE_STYLE, + ::getCppuType( reinterpret_cast< const drawing::LineStyle * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + rOutProperties.push_back( + Property( C2U( "LineWidth" ), + PROP_DATAPOINT_LINE_WIDTH, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + rOutProperties.push_back( + Property( C2U( "LineDash" ), + PROP_DATAPOINT_LINE_DASH, + ::getCppuType( reinterpret_cast< const drawing::LineDash * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEVOID )); + + // others + rOutProperties.push_back( + Property( C2U( "Symbol" ), + PROP_DATAPOINT_SYMBOL, + ::getCppuType( reinterpret_cast< const drawing::PolyPolygonBezierCoords * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEVOID )); + rOutProperties.push_back( + Property( C2U( "Offset" ), + PROP_DATAPOINT_OFFSET, + ::getCppuType( reinterpret_cast< const double * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "DataCaption" ), + PROP_DATAPOINT_DATA_CAPTION, + ::getCppuType( reinterpret_cast< const chart2::DataCaptionStyle * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "NumberFormat" ), + PROP_DATAPOINT_NUMBER_FORMAT, + ::getCppuType( reinterpret_cast< const chart2::NumberFormat * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); +} + +void DataPointProperties::AddDefaultsToMap( + ::chart::helper::tPropertyValueMap & rOutMap, + bool bIncludeStyleProperties /* = false */ ) +{ + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_COLOR )); + rOutMap[ PROP_DATAPOINT_COLOR ] = + uno::makeAny( sal_Int32( 0x0000b8ff )); // blue 7 + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_TRANSPARENCY )); + rOutMap[ PROP_DATAPOINT_TRANSPARENCY ] = + uno::makeAny( sal_Int16( 0 ) ); + + //fill + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_FILL_STYLE )); + rOutMap[ PROP_DATAPOINT_FILL_STYLE ] = + uno::makeAny( drawing::FillStyle_SOLID ); + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_TRANSPARENCY_STYLE )); + rOutMap[ PROP_DATAPOINT_TRANSPARENCY_STYLE ] = + uno::makeAny( chart2::TransparencyStyle_NONE ); + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_TRANSPARENCY_GRADIENT )); + rOutMap[ PROP_DATAPOINT_TRANSPARENCY_GRADIENT ] = + uno::Any();//need this empty default value otherwise get a costly exception in DataSeries::GetDefaultValue + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_GRADIENT )); + rOutMap[ PROP_DATAPOINT_GRADIENT ] = + uno::Any();//need this empty default value otherwise get a costly exception in DataSeries::GetDefaultValue + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_HATCH )); + rOutMap[ PROP_DATAPOINT_HATCH ] = + uno::Any();//need this empty default value otherwise get a costly exception in DataSeries::GetDefaultValue + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_BITMAP )); + rOutMap[ PROP_DATAPOINT_BITMAP ] = + uno::Any();//need this empty default value otherwise get a costly exception in DataSeries::GetDefaultValue + + //border + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_BORDER_COLOR )); + rOutMap[ PROP_DATAPOINT_BORDER_COLOR ] = + uno::makeAny( sal_Int32( 0x00000000 )); // black + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_BORDER_STYLE )); + rOutMap[ PROP_DATAPOINT_BORDER_STYLE ] = + uno::makeAny( drawing::LineStyle_SOLID ); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_BORDER_WIDTH )); + rOutMap[ PROP_DATAPOINT_BORDER_WIDTH ] = + uno::makeAny( sal_Int32( 0 ) ); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_BORDER_DASH )); + rOutMap[ PROP_DATAPOINT_BORDER_DASH ] = + uno::Any();//need this empty default value otherwise get a costly exception in DataSeries::GetDefaultValue + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_BORDER_TRANSPARENCY )); + rOutMap[ PROP_DATAPOINT_BORDER_TRANSPARENCY ] = + uno::makeAny( sal_Int16( 0 ) ); + + //line + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_LINE_STYLE )); + rOutMap[ PROP_DATAPOINT_LINE_STYLE ] = + uno::makeAny( drawing::LineStyle_SOLID ); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_LINE_WIDTH )); + rOutMap[ PROP_DATAPOINT_LINE_WIDTH ] = + uno::makeAny( sal_Int32( 0 ) ); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_LINE_DASH )); + rOutMap[ PROP_DATAPOINT_LINE_DASH ] = + uno::Any();//need this empty default value otherwise get a costly exception in DataSeries::GetDefaultValue + + + //others + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_SYMBOL )); + rOutMap[ PROP_DATAPOINT_SYMBOL ] = + uno::Any();//need this empty default value otherwise get a costly exception in DataSeries::GetDefaultValue + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_OFFSET )); + rOutMap[ PROP_DATAPOINT_OFFSET ] = + uno::makeAny( double( 0.0 ) ); + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_DATA_CAPTION )); + rOutMap[ PROP_DATAPOINT_DATA_CAPTION ] = + uno::makeAny( chart2::DataCaptionStyle( + sal_False, // ShowNumber + sal_False, // ShowNumberInPercent + sal_False, // ShowCategoryName + sal_False // ShowLegendSymbol + )); + + chart2::NumberFormat aFormat( + C2U( "Standard" ), + lang::Locale( C2U( "DE" ), C2U( "de" ), ::rtl::OUString())); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATAPOINT_NUMBER_FORMAT )); + rOutMap[ PROP_DATAPOINT_NUMBER_FORMAT ] = + uno::makeAny( aFormat ); +} + +} // namespace chart diff --git a/chart2/source/model/main/DataPointProperties.hxx b/chart2/source/model/main/DataPointProperties.hxx new file mode 100644 index 000000000000..010427657d82 --- /dev/null +++ b/chart2/source/model/main/DataPointProperties.hxx @@ -0,0 +1,129 @@ +/************************************************************************* + * + * $RCSfile: DataPointProperties.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_DATAPOINTPROPERTIES_HXX +#define CHART_DATAPOINTPROPERTIES_HXX + +#include "PropertyHelper.hxx" +#include "FastPropertyIdRanges.hxx" + +#ifndef _COM_SUN_STAR_BEANS_PROPERTY_HPP_ +#include <com/sun/star/beans/Property.hpp> +#endif + +#include <vector> + +namespace chart +{ + +// implements service DataPointProperties +class DataPointProperties +{ +public: + // FastProperty Ids for properties + enum + { + // common + PROP_DATAPOINT_STYLE = FAST_PROPERTY_ID_START_DATA_POINT, + PROP_DATAPOINT_COLOR, + PROP_DATAPOINT_TRANSPARENCY, + + // fill + PROP_DATAPOINT_FILL_STYLE, + PROP_DATAPOINT_TRANSPARENCY_STYLE, + PROP_DATAPOINT_TRANSPARENCY_GRADIENT, + PROP_DATAPOINT_GRADIENT, + PROP_DATAPOINT_HATCH, + PROP_DATAPOINT_BITMAP, + + // border (of filled objects) + PROP_DATAPOINT_BORDER_COLOR, + PROP_DATAPOINT_BORDER_STYLE, + PROP_DATAPOINT_BORDER_WIDTH, + PROP_DATAPOINT_BORDER_DASH, + PROP_DATAPOINT_BORDER_TRANSPARENCY, + + // line + PROP_DATAPOINT_LINE_STYLE, + PROP_DATAPOINT_LINE_WIDTH, + PROP_DATAPOINT_LINE_DASH, + + // others + PROP_DATAPOINT_SYMBOL, + PROP_DATAPOINT_OFFSET, + PROP_DATAPOINT_DATA_CAPTION, + PROP_DATAPOINT_NUMBER_FORMAT + }; + + static void AddPropertiesToVector( + ::std::vector< ::com::sun::star::beans::Property > & rOutProperties, + bool bIncludeStyleProperties = false ); + + static void AddDefaultsToMap( ::chart::helper::tPropertyValueMap & rOutMap, bool bIncludeStyleProperties = false ); + +private: + // not implemented + DataPointProperties(); +}; + +} // namespace chart + +// CHART_DATAPOINTPROPERTIES_HXX +#endif diff --git a/chart2/source/model/main/DataPointStyle.cxx b/chart2/source/model/main/DataPointStyle.cxx new file mode 100644 index 000000000000..64533c303b55 --- /dev/null +++ b/chart2/source/model/main/DataPointStyle.cxx @@ -0,0 +1,216 @@ +/************************************************************************* + * + * $RCSfile: DataPointStyle.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "DataPointStyle.hxx" +#include "DataPointProperties.hxx" +#include "PropertyHelper.hxx" +#include "macros.hxx" +#include "algohelper.hxx" + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif +#ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_ +#include <com/sun/star/style/XStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif + +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ +#include <com/sun/star/uno/Sequence.hxx> +#endif + +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::beans::Property; +using ::osl::MutexGuard; + +// ____________________________________________________________ + +namespace +{ +const uno::Sequence< Property > & lcl_GetPropertySequence() +{ + static uno::Sequence< Property > aPropSeq; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + ::chart::DataPointProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ false ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::helper::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::helper::VectorToSequence( aProperties ); + } + + return aPropSeq; +} +} // anonymous namespace + +// ____________________________________________________________ + +namespace chart +{ + +DataPointStyle::DataPointStyle( + const uno::Reference< container::XNameAccess > & xStyleFamily, + ::osl::Mutex & _rMutex ) : + ::property::OStyle( xStyleFamily, _rMutex ), + m_rMutex( _rMutex ) +{} + +DataPointStyle::~DataPointStyle() +{} + +// ____ XInterface ____ +uno::Any SAL_CALL DataPointStyle::queryInterface( + const uno::Type & rType ) + throw (uno::RuntimeException) +{ + return ::cppu::OWeakObject::queryInterface( rType ); +} + +void SAL_CALL DataPointStyle::acquire() throw () +{ + ::cppu::OWeakObject::acquire(); +} + +void SAL_CALL DataPointStyle::release() throw () +{ + ::cppu::OWeakObject::release(); +} + +// ____ OPropertySet ____ +uno::Any DataPointStyle::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static helper::tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + // initialize defaults + DataPointProperties::AddDefaultsToMap( + aStaticDefaults, + /* bIncludeStyleProperties = */ false ); + } + + helper::tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + throw beans::UnknownPropertyException(); + + return (*aFound).second; + // \-- +} + +::cppu::IPropertyArrayHelper & SAL_CALL DataPointStyle::getInfoHelper() +{ + return getInfoHelperConst(); +} + +::cppu::IPropertyArrayHelper & SAL_CALL DataPointStyle::getInfoHelperConst() const +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( + lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + +// ____ XPropertySet ____ +Reference< beans::XPropertySetInfo > SAL_CALL + DataPointStyle::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static Reference< beans::XPropertySetInfo > xInfo; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +::osl::Mutex & DataPointStyle::GetMutex() +{ + return m_rMutex; +} + +} // namespace chart diff --git a/chart2/source/model/main/DataPointStyle.hxx b/chart2/source/model/main/DataPointStyle.hxx new file mode 100644 index 000000000000..ab26df675919 --- /dev/null +++ b/chart2/source/model/main/DataPointStyle.hxx @@ -0,0 +1,118 @@ +/************************************************************************* + * + * $RCSfile: DataPointStyle.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_DATAPOINTSTYLE_HXX +#define CHART_DATAPOINTSTYLE_HXX + +#ifndef _CPPUHELPER_WEAK_HXX_ +#include <cppuhelper/weak.hxx> +#endif +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif + +#include "OStyle.hxx" + +namespace chart +{ + +class DataPointStyle : + public ::cppu::OWeakObject, + public ::property::OStyle +{ +public: + DataPointStyle( const ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess > & xStyleFamily, + ::osl::Mutex & rMutex ); + virtual ~DataPointStyle(); + + // ____ XInterface ____ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type & rType ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() throw (); + virtual void SAL_CALL release() throw (); + +protected: + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + + ::osl::Mutex & GetMutex(); + + /** const variant of getInfoHelper() + */ + ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelperConst() const; + +private: + ::osl::Mutex & m_rMutex; +}; + +} // namespace chart + +// CHART_DATAPOINTSTYLE_HXX +#endif diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx new file mode 100644 index 000000000000..ecdec74d1f29 --- /dev/null +++ b/chart2/source/model/main/DataSeries.cxx @@ -0,0 +1,302 @@ +/************************************************************************* + * + * $RCSfile: DataSeries.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2002 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "DataSeries.hxx" +#include "DataSeriesProperties.hxx" +#include "CharacterProperties.hxx" +#include "UserDefinedProperties.hxx" +#include "DataPoint.hxx" +#include "macros.hxx" +#include "algohelper.hxx" + +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +using ::com::sun::star::beans::Property; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::rtl::OUString; +using ::osl::MutexGuard; + +// ---------------------------------------- + +namespace +{ +const uno::Sequence< Property > & lcl_GetPropertySequence() +{ + static uno::Sequence< Property > aPropSeq; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + ::chart::DataSeriesProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ true ); + ::chart::CharacterProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ true ); + ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::helper::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::helper::VectorToSequence( aProperties ); + } + + return aPropSeq; +} +} // anonymous namespace + +// ---------------------------------------- + +namespace chart +{ + +DataSeries::DataSeries( const ::rtl::OUString & rIdentifier ) : + ::property::OPropertySet( m_aMutex ), + m_aIdentifier( rIdentifier ) +{} + +DataSeries::~DataSeries() +{} + +Sequence< OUString > DataSeries::getSupportedServiceNames_Static() +{ + Sequence< OUString > aServices( 3 ); + aServices[ 0 ] = C2U( "drafts.com.sun.star.chart2.DataSeries" ); + aServices[ 1 ] = C2U( "drafts.com.sun.star.chart2.DataPointProperties" ); + aServices[ 2 ] = C2U( "com.sun.star.beans.PropertySet" ); + return aServices; +} + + +// ____ OPropertySet ____ +uno::Any DataSeries::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static helper::tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + // initialize defaults + DataSeriesProperties::AddDefaultsToMap( + aStaticDefaults, + /* bIncludeStyleProperties = */ true ); + CharacterProperties::AddDefaultsToMap( + aStaticDefaults, + /* bIncludeStyleProperties = */ true ); + } + + helper::tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + { + if( nHandle == DataSeriesProperties::PROP_DATASERIES_IDENTIFIER ) + { + return uno::makeAny( m_aIdentifier ); + } + else + throw beans::UnknownPropertyException(); + } + + return (*aFound).second; + // \-- +} + +// ____ OPropertySet ____ +::cppu::IPropertyArrayHelper & SAL_CALL DataSeries::getInfoHelper() +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( + lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + + +// ____ XPropertySet ____ +uno::Reference< beans::XPropertySetInfo > SAL_CALL + DataSeries::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static uno::Reference< beans::XPropertySetInfo > xInfo; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +void SAL_CALL DataSeries::getFastPropertyValue + ( uno::Any& rValue, + sal_Int32 nHandle ) const +{ + // special handling for get. set is not possible for this property + if( nHandle == DataSeriesProperties::PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) + { + // ToDo: only add those property sets that are really modified + uno::Sequence< sal_Int32 > aSeq( m_aAttributedDataPoints.size()); + sal_Int32 * pIndexArray = aSeq.getArray(); + sal_Int32 i = 0; + + for( tDataPointAttributeContainer::const_iterator aIt( m_aAttributedDataPoints.begin()); + aIt != m_aAttributedDataPoints.end(); ++aIt ) + { + pIndexArray[ i ] = (*aIt).first; + ++i; + } + + rValue <<= aSeq; + } + else + OPropertySet::getFastPropertyValue( rValue, nHandle ); +} + +Reference< beans::XPropertySet > + SAL_CALL DataSeries::getDataPointByIndex( sal_Int32 nIndex ) + throw (lang::IndexOutOfBoundsException, + uno::RuntimeException) +{ + Reference< beans::XPropertySet > aResult; + + // /-- + MutexGuard aGuard( GetMutex() ); + + if( m_aDataSequences.begin() != m_aDataSequences.end()) + { + if( 0 <= nIndex && nIndex < + (*(m_aDataSequences.begin()))->getData().getLength() ) + { + tDataPointAttributeContainer::iterator aIt( + m_aAttributedDataPoints.find( nIndex )); + + if( aIt == m_aAttributedDataPoints.end()) + { + // create a new XPropertySet for this data point + aResult.set( new DataPoint( GetMutex(), this )); + m_aAttributedDataPoints[ nIndex ] = aResult; + } + else + { + aResult = (*aIt).second; + } + } + else + { + throw lang::IndexOutOfBoundsException(); + } + } + else + { + throw lang::IndexOutOfBoundsException(); + } + + return aResult; + // \-- +} + +// ____ XDataSink ____ +void SAL_CALL DataSeries::setData( const uno::Sequence< Reference< chart2::XDataSequence > >& aData ) + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + m_aDataSequences = helper::SequenceToVector( aData ); + // \-- +} + +// ____ XDataSource ____ +Sequence< Reference< chart2::XDataSequence > > SAL_CALL DataSeries::getDataSequences() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return helper::VectorToSequence( m_aDataSequences ); + // \-- +} + +// ================================================================================ + +using impl::DataSeries_Base; +using ::property::OPropertySet; + +IMPLEMENT_FORWARD_XINTERFACE2( DataSeries, DataSeries_Base, OPropertySet ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( DataSeries, DataSeries_Base, OPropertySet ) + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( DataSeries, + C2U( "com.sun.star.comp.chart.DataSeries" )); + +} // namespace chart diff --git a/chart2/source/model/main/DataSeriesProperties.cxx b/chart2/source/model/main/DataSeriesProperties.cxx new file mode 100644 index 000000000000..4e5e19d9076a --- /dev/null +++ b/chart2/source/model/main/DataSeriesProperties.cxx @@ -0,0 +1,134 @@ +/************************************************************************* + * + * $RCSfile: DataSeriesProperties.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "DataSeriesProperties.hxx" +#include "DataPointProperties.hxx" +#include "DataPoint.hxx" +#include "macros.hxx" + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif +#ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_ +#include <com/sun/star/style/XStyle.hpp> +#endif + +#include <algorithm> + +using namespace ::com::sun::star; + +using ::rtl::OUString; +using ::com::sun::star::beans::Property; +using ::com::sun::star::uno::Reference; + +namespace chart +{ + +void DataSeriesProperties::AddPropertiesToVector( + ::std::vector< Property > & rOutProperties, + bool bIncludeStyleProperties /* = false */ ) +{ + rOutProperties.push_back( + Property( C2U( "DataPointStyle" ), + PROP_DATASERIES_DATA_POINT_STYLE, + ::getCppuType( reinterpret_cast< const Reference< style::XStyle > * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "AttributedDataPoints" ), + PROP_DATASERIES_ATTRIBUTED_DATA_POINTS, + ::getCppuType( reinterpret_cast< const uno::Sequence< sal_Int32 > * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEVOID )); + + rOutProperties.push_back( + Property( C2U( "Identifier" ), + PROP_DATASERIES_IDENTIFIER, + ::getCppuType( reinterpret_cast< const ::rtl::OUString * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY + | beans::PropertyAttribute::MAYBEVOID )); + + // add properties of service DataPointProperties + DataPointProperties::AddPropertiesToVector( + rOutProperties, bIncludeStyleProperties ); +} + +void DataSeriesProperties::AddDefaultsToMap( + helper::tPropertyValueMap & rOutMap, + bool bIncludeStyleProperties /* = false */ ) +{ + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DATASERIES_DATA_POINT_STYLE )); + rOutMap[ PROP_DATASERIES_DATA_POINT_STYLE ] = + uno::makeAny( Reference< style::XStyle >() ); + + // PROP_DATASERIES_ATTRIBUTED_DATA_POINTS has no default + + // PROP_DATASERIES_IDENTIFIER has no default + // It is read-only. So there will be a 'static' default handled in + // DataSeries + + // add properties of service DataPointProperties + DataPointProperties::AddDefaultsToMap( + rOutMap, bIncludeStyleProperties ); +} + +} // namespace chart diff --git a/chart2/source/model/main/DataSeriesProperties.hxx b/chart2/source/model/main/DataSeriesProperties.hxx new file mode 100644 index 000000000000..efa191d23266 --- /dev/null +++ b/chart2/source/model/main/DataSeriesProperties.hxx @@ -0,0 +1,100 @@ +/************************************************************************* + * + * $RCSfile: DataSeriesProperties.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_DATASERIESPROPERTIES_HXX +#define CHART_DATASERIESPROPERTIES_HXX + +#include "PropertyHelper.hxx" +#include "FastPropertyIdRanges.hxx" + +#ifndef _COM_SUN_STAR_BEANS_PROPERTY_HPP_ +#include <com/sun/star/beans/Property.hpp> +#endif + +#include <vector> + +namespace chart +{ + +class DataSeriesProperties +{ +public: + enum + { + PROP_DATASERIES_DATA_POINT_STYLE = FAST_PROPERTY_ID_START_DATA_SERIES, + PROP_DATASERIES_ATTRIBUTED_DATA_POINTS, + PROP_DATASERIES_IDENTIFIER + }; + + static void AddPropertiesToVector( + ::std::vector< ::com::sun::star::beans::Property > & rOutProperties, + bool bIncludeStyleProperties = false ); + + static void AddDefaultsToMap( helper::tPropertyValueMap & rOutMap, bool bIncludeStyleProperties = false ); + +private: + // not implemented + DataSeriesProperties(); +}; + +} // namespace chart + +// CHART_DATASERIESPROPERTIES_HXX +#endif diff --git a/chart2/source/model/main/DataSeriesStyle.cxx b/chart2/source/model/main/DataSeriesStyle.cxx new file mode 100644 index 000000000000..57bdf106de70 --- /dev/null +++ b/chart2/source/model/main/DataSeriesStyle.cxx @@ -0,0 +1,222 @@ +/************************************************************************* + * + * $RCSfile: DataSeriesStyle.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "DataSeriesStyle.hxx" +#include "DataSeriesProperties.hxx" +#include "CharacterProperties.hxx" +#include "PropertyHelper.hxx" +#include "macros.hxx" +#include "algohelper.hxx" + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif +#ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_ +#include <com/sun/star/style/XStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif + +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ +#include <com/sun/star/uno/Sequence.hxx> +#endif + +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::beans::Property; +using ::osl::MutexGuard; + +// ____________________________________________________________ + +namespace +{ +const uno::Sequence< Property > & lcl_GetPropertySequence() +{ + static uno::Sequence< Property > aPropSeq; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + ::chart::DataSeriesProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ false ); + ::chart::CharacterProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ false ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::helper::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::helper::VectorToSequence( aProperties ); + } + + return aPropSeq; +} +} // anonymous namespace + +// ____________________________________________________________ + +namespace chart +{ + +DataSeriesStyle::DataSeriesStyle( + const uno::Reference< container::XNameAccess > & xStyleFamily, + ::osl::Mutex & _rMutex ) : + ::property::OStyle( xStyleFamily, _rMutex ), + m_rMutex( _rMutex ) +{} + +DataSeriesStyle::~DataSeriesStyle() +{} + +// ____ XInterface ____ +uno::Any SAL_CALL DataSeriesStyle::queryInterface( + const uno::Type & rType ) + throw (uno::RuntimeException) +{ + return ::cppu::OWeakObject::queryInterface( rType ); +} + +void SAL_CALL DataSeriesStyle::acquire() throw () +{ + ::cppu::OWeakObject::acquire(); +} + +void SAL_CALL DataSeriesStyle::release() throw () +{ + ::cppu::OWeakObject::release(); +} + +// ____ OPropertySet ____ +uno::Any DataSeriesStyle::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static helper::tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + // initialize defaults + DataSeriesProperties::AddDefaultsToMap( + aStaticDefaults, + /* bIncludeStyleProperties = */ false ); + CharacterProperties::AddDefaultsToMap( + aStaticDefaults, + /* bIncludeStyleProperties = */ false ); + } + + helper::tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + throw beans::UnknownPropertyException(); + + return (*aFound).second; + // \-- +} + +::cppu::IPropertyArrayHelper & SAL_CALL DataSeriesStyle::getInfoHelper() +{ + return getInfoHelperConst(); +} + +::cppu::IPropertyArrayHelper & SAL_CALL DataSeriesStyle::getInfoHelperConst() const +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( + lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + +// ____ XPropertySet ____ +Reference< beans::XPropertySetInfo > SAL_CALL + DataSeriesStyle::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static Reference< beans::XPropertySetInfo > xInfo; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +::osl::Mutex & DataSeriesStyle::GetMutex() +{ + return m_rMutex; +} + +} // namespace chart diff --git a/chart2/source/model/main/DataSeriesStyle.hxx b/chart2/source/model/main/DataSeriesStyle.hxx new file mode 100644 index 000000000000..4b4706a56445 --- /dev/null +++ b/chart2/source/model/main/DataSeriesStyle.hxx @@ -0,0 +1,118 @@ +/************************************************************************* + * + * $RCSfile: DataSeriesStyle.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:30 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_DATASERIESSTYLE_HXX +#define CHART_DATASERIESSTYLE_HXX + +#ifndef _CPPUHELPER_WEAK_HXX_ +#include <cppuhelper/weak.hxx> +#endif +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif + +#include "OStyle.hxx" + +namespace chart +{ + +class DataSeriesStyle : + public ::cppu::OWeakObject, + public ::property::OStyle +{ +public: + DataSeriesStyle( const ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess > & xStyleFamily, + ::osl::Mutex & rMutex ); + virtual ~DataSeriesStyle(); + + // ____ XInterface ____ + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type & rType ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() throw (); + virtual void SAL_CALL release() throw (); + +protected: + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + + ::osl::Mutex & GetMutex(); + + /** const variant of getInfoHelper() + */ + ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelperConst() const; + +private: + ::osl::Mutex & m_rMutex; +}; + +} // namespace chart + +// CHART_DATASERIESSTYLE_HXX +#endif diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx new file mode 100644 index 000000000000..ec8ef402170f --- /dev/null +++ b/chart2/source/model/main/Diagram.cxx @@ -0,0 +1,490 @@ +/************************************************************************* + * + * $RCSfile: Diagram.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Diagram.hxx" +#include "macros.hxx" +#include "PropertyHelper.hxx" +#include "algohelper.hxx" +#include "Wall.hxx" +#include "TitleHelper.hxx" +#include "ContextHelper.hxx" +#include "UserDefinedProperties.hxx" + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif + +#include <algorithm> +#include <iterator> +#include <functional> + +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans::PropertyAttribute; +using namespace ::drafts::com::sun::star; + +using ::rtl::OUString; +using ::com::sun::star::beans::Property; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::osl::MutexGuard; + +// ====================================================================== + +namespace +{ + +// enum +// { +// PROP_DIAGRAM_PREFERRED_ALIGNMENT, +// PROP_DIAGRAM_PREFERRED_STRETCH_MODE +// }; + +void lcl_AddPropertiesToVector( + ::std::vector< Property > & rOutProperties ) +{ +// rOutProperties.push_back( +// Property( C2U( "PreferredAlignment" ), +// PROP_DIAGRAM_PREFERRED_ALIGNMENT, +// ::getCppuType( reinterpret_cast< const layout::Alignment * >(0)), +// beans::PropertyAttribute::BOUND +// | beans::PropertyAttribute::MAYBEDEFAULT )); + +// rOutProperties.push_back( +// Property( C2U( "PreferredStretchMode" ), +// PROP_DIAGRAM_PREFERRED_STRETCH_MODE, +// ::getCppuType( reinterpret_cast< const layout::StretchMode * >(0)), +// beans::PropertyAttribute::BOUND +// | beans::PropertyAttribute::MAYBEDEFAULT )); +} + +void lcl_AddDefaultsToMap( + ::chart::helper::tPropertyValueMap & rOutMap ) +{ +// layout::Alignment aCenterAlign( 0.5, 0.5, true ); +// OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DIAGRAM_PREFERRED_ALIGNMENT )); +// rOutMap[ PROP_DIAGRAM_PREFERRED_ALIGNMENT ] = +// uno::makeAny( aCenterAlign ); + +// OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_DIAGRAM_PREFERRED_STRETCH_MODE )); +// rOutMap[ PROP_DIAGRAM_PREFERRED_STRETCH_MODE ] = +// uno::makeAny( layout::StretchMode_BOTH ); +} + +const Sequence< Property > & lcl_GetPropertySequence() +{ + static Sequence< Property > aPropSeq; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + lcl_AddPropertiesToVector( aProperties ); + ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::helper::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::helper::VectorToSequence( aProperties ); + } + + return aPropSeq; +} + +} // anonymous namespace + +// ====================================================================== + +namespace chart +{ + +Diagram::Diagram( uno::Reference< uno::XComponentContext > const & xContext ) : + ::property::OPropertySet( m_aMutex ), + m_xContext( xContext ), + m_xWall( new Wall()), + m_xTitle( NULL ), + m_aIdentifier( C2U( "@diagram" )) +{ +} + +Diagram::~Diagram() +{} + +// ____ XDiagram ____ +Reference< chart2::XDataSeriesTreeParent > SAL_CALL Diagram::getTree() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return m_xSeriesTree; + // \-- +} + +void SAL_CALL Diagram::setTree( + const Reference< chart2::XDataSeriesTreeParent >& xTree ) + throw (lang::IllegalArgumentException, + uno::RuntimeException) +{ + uno::Reference< lang::XServiceInfo > xInfo( xTree, uno::UNO_QUERY ); + if( xInfo.is() && + xInfo->supportsService( C2U( "drafts.com.sun.star.chart2.DataSeriesTree" )) ) + { + // /-- + MutexGuard aGuard( GetMutex() ); + m_xSeriesTree = xTree; + // \-- + } + else + { + throw lang::IllegalArgumentException(); + } +} + +uno::Reference< beans::XPropertySet > SAL_CALL Diagram::getWall() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return m_xWall; + // \-- +} + +uno::Reference< chart2::XLegend > SAL_CALL Diagram::getLegend() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return m_xLegend; + // \-- +} + +void SAL_CALL Diagram::setLegend( const uno::Reference< chart2::XLegend >& xLegend ) + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + m_xLegend = xLegend; + // \-- +} + +// ____ XAxisContainer ____ +void SAL_CALL Diagram::addAxis( const uno::Reference< chart2::XAxis >& aAxis ) + throw (lang::IllegalArgumentException, + uno::RuntimeException) +{ + uno::Reference< chart2::XIdentifiable > xIdent( aAxis, uno::UNO_QUERY ); + if( ! xIdent.is() || + m_aAxes.find( xIdent->getIdentifier() ) != m_aAxes.end() ) + throw lang::IllegalArgumentException(); + + m_aAxes.insert( tAxisContainerType::value_type( xIdent->getIdentifier(), aAxis ) ); +} + +void SAL_CALL Diagram::removeAxis( const uno::Reference< chart2::XAxis >& aAxis ) + throw (container::NoSuchElementException, + uno::RuntimeException) +{ + if( ! aAxis.is()) + throw container::NoSuchElementException(); + + uno::Reference< chart2::XIdentifiable > xIdent( aAxis, uno::UNO_QUERY ); + if( xIdent.is()) + { + tAxisContainerType::iterator aIt( m_aAxes.find( xIdent->getIdentifier() )); + + if( aIt == m_aAxes.end()) + throw container::NoSuchElementException(); + + m_aAxes.erase( aIt ); + } + else + throw container::NoSuchElementException(); +} + +uno::Sequence< uno::Reference< chart2::XAxis > > SAL_CALL Diagram::getAxes() + throw (uno::RuntimeException) +{ + uno::Sequence< uno::Reference< chart2::XAxis > > aResult( m_aAxes.size()); + + ::std::transform( m_aAxes.begin(), m_aAxes.end(), + aResult.getArray(), + ::std::select2nd< tAxisContainerType::value_type >() ); + + return aResult; +} + +uno::Reference< chart2::XAxis > SAL_CALL Diagram::getAxisByIdentifier( const ::rtl::OUString& aIdentifier ) + throw (uno::RuntimeException) +{ + if(!aIdentifier.getLength()) + return NULL; + uno::Reference< chart2::XAxis > aResult; + tAxisContainerType::const_iterator aIt( m_aAxes.find( aIdentifier )); + + if( aIt != m_aAxes.end()) + aResult = (*aIt).second; + + return aResult; +} + +// ____ XGridContainer ____ +void SAL_CALL Diagram::addGrid( const uno::Reference< chart2::XGrid >& aGrid ) + throw (lang::IllegalArgumentException, + uno::RuntimeException) +{ + uno::Reference< chart2::XIdentifiable > xIdent( aGrid, uno::UNO_QUERY ); + if( ! xIdent.is() || + m_aGrids.find( xIdent->getIdentifier() ) != m_aGrids.end() ) + throw lang::IllegalArgumentException(); + + m_aGrids.insert( tGridContainerType::value_type( xIdent->getIdentifier(), aGrid )); +} + +void SAL_CALL Diagram::removeGrid( const uno::Reference< chart2::XGrid >& aGrid ) + throw (container::NoSuchElementException, + uno::RuntimeException) +{ + if( ! aGrid.is()) + throw container::NoSuchElementException(); + + uno::Reference< chart2::XIdentifiable > xIdent( aGrid, uno::UNO_QUERY ); + if( xIdent.is()) + { + tGridContainerType::iterator aIt( m_aGrids.find( xIdent->getIdentifier() )); + + if( aIt == m_aGrids.end()) + throw container::NoSuchElementException(); + + m_aGrids.erase( aIt ); + } + else + throw container::NoSuchElementException(); +} + +uno::Sequence< uno::Reference< chart2::XGrid > > SAL_CALL Diagram::getGrids() + throw (uno::RuntimeException) +{ + uno::Sequence< uno::Reference< chart2::XGrid > > aResult( m_aGrids.size()); + + ::std::transform( m_aGrids.begin(), m_aGrids.end(), + aResult.getArray(), + ::std::select2nd< tGridContainerType::value_type >() ); + + return aResult; +} + +uno::Reference< chart2::XGrid > SAL_CALL Diagram::getGridByIdentifier( const ::rtl::OUString& aIdentifier ) + throw (uno::RuntimeException) +{ + if(!aIdentifier.getLength()) + return NULL; + uno::Reference< chart2::XGrid > aResult; + tGridContainerType::const_iterator aIt( m_aGrids.find( aIdentifier )); + + if( aIt != m_aGrids.end()) + aResult = (*aIt).second; + + return aResult; +} + +// ____ XTitled ____ +uno::Reference< chart2::XTitle > SAL_CALL Diagram::getTitle() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return m_xTitle; + // \-- +} + +void SAL_CALL Diagram::setTitle( const uno::Reference< chart2::XTitle >& Title ) + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + m_xTitle = Title; + // \-- +} + +// ____ XBoundedCoordinateSystemContainer ____ +void SAL_CALL Diagram::addCoordinateSystem( + const uno::Reference< chart2::XBoundedCoordinateSystem >& aCoordSys ) + throw (lang::IllegalArgumentException, + uno::RuntimeException) +{ +// if( m_aCoordSystems.find( aCoordSys ) != m_aCoordSystems.end()) + if( ::std::find( m_aCoordSystems.begin(), m_aCoordSystems.end(), aCoordSys ) + != m_aCoordSystems.end()) + throw lang::IllegalArgumentException(); + +// m_aCoordSystems.insert( aCoordSys ); + m_aCoordSystems.push_back( aCoordSys ); +} + +void SAL_CALL Diagram::removeCoordinateSystem( + const uno::Reference< chart2::XBoundedCoordinateSystem >& aCoordSys ) + throw (container::NoSuchElementException, + uno::RuntimeException) +{ + ::std::vector< uno::Reference< chart2::XBoundedCoordinateSystem > >::iterator + aIt( ::std::find( m_aCoordSystems.begin(), m_aCoordSystems.end(), aCoordSys )); +// if( m_aCoordSystems.find( aCoordSys ) == m_aCoordSystems.end()) + if( aIt != m_aCoordSystems.end()) + throw container::NoSuchElementException(); + +// m_aCoordSystems.erase( aCoordSys ); + m_aCoordSystems.erase( aIt ); +} + +uno::Sequence< uno::Reference< chart2::XBoundedCoordinateSystem > > SAL_CALL Diagram::getCoordinateSystems() + throw (uno::RuntimeException) +{ +// return helper::SetToSequence( m_aCoordSystems ); + return helper::VectorToSequence( m_aCoordSystems ); +} + +// ____ XIdentifiable ____ +::rtl::OUString SAL_CALL Diagram::getIdentifier() + throw (uno::RuntimeException) +{ + return m_aIdentifier; +} + +// ________ + +Sequence< OUString > Diagram::getSupportedServiceNames_Static() +{ + Sequence< OUString > aServices( 3 ); + + aServices[ 0 ] = C2U( "drafts.com.sun.star.chart2.Diagram" ); + aServices[ 1 ] = C2U( "drafts.com.sun.star.layout.LayoutElement" ); + aServices[ 2 ] = C2U( "com.sun.star.beans.PropertySet" ); + return aServices; +} + +// ____ OPropertySet ____ +uno::Any Diagram::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static helper::tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + // initialize defaults + lcl_AddDefaultsToMap( aStaticDefaults ); + } + + helper::tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + return uno::Any(); + + return (*aFound).second; + // \-- +} + +// ____ OPropertySet ____ +::cppu::IPropertyArrayHelper & SAL_CALL Diagram::getInfoHelper() +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + + +// ____ XPropertySet ____ +uno::Reference< beans::XPropertySetInfo > SAL_CALL + Diagram::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static uno::Reference< beans::XPropertySetInfo > xInfo; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +// ================================================================================ + +using impl::Diagram_Base; + +IMPLEMENT_FORWARD_XINTERFACE2( Diagram, Diagram_Base, ::property::OPropertySet ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( Diagram, Diagram_Base, ::property::OPropertySet ) + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( Diagram, + C2U( "com.sun.star.comp.chart.Diagram" )); + +} // namespace chart diff --git a/chart2/source/model/main/FormattedString.cxx b/chart2/source/model/main/FormattedString.cxx new file mode 100644 index 000000000000..e3c652f6e38d --- /dev/null +++ b/chart2/source/model/main/FormattedString.cxx @@ -0,0 +1,227 @@ +/************************************************************************* + * + * $RCSfile: FormattedString.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "FormattedString.hxx" + +#include "CharacterProperties.hxx" +#include "PropertyHelper.hxx" +#include "algohelper.hxx" +#include "macros.hxx" + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +using ::rtl::OUString; +using ::com::sun::star::beans::Property; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::osl::MutexGuard; + +namespace +{ + +const Sequence< Property > & lcl_GetPropertySequence() +{ + static Sequence< Property > aPropSeq; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + ::chart::CharacterProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ true ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::helper::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::helper::VectorToSequence( aProperties ); + } + + return aPropSeq; +} + +} // anonymous namespace + +namespace chart +{ + +FormattedString::FormattedString( const ::rtl::OUString & rString ) : + ::property::OPropertySet( m_aMutex ), + m_aString( rString ) +{} + +FormattedString::FormattedString( + uno::Reference< uno::XComponentContext > const & xContext ) : + ::property::OPropertySet( m_aMutex ), + m_aString() +{} + +FormattedString::~FormattedString() +{} + +// ____ XFormattedString ____ +::rtl::OUString SAL_CALL FormattedString::getString() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex()); + return m_aString; + // \-- +} + +void SAL_CALL FormattedString::setString( const ::rtl::OUString& String ) + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex()); + m_aString = String; + // \-- +} + +// ---------------------------------------- + +Sequence< OUString > FormattedString::getSupportedServiceNames_Static() +{ + Sequence< OUString > aServices( 2 ); + + aServices[ 0 ] = C2U( "drafts.com.sun.star.chart2.FormattedString" ); + aServices[ 1 ] = C2U( "com.sun.star.beans.PropertySet" ); + return aServices; +} + +// ____ OPropertySet ____ +uno::Any FormattedString::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static helper::tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + // initialize defaults + CharacterProperties::AddDefaultsToMap( + aStaticDefaults, + /* bIncludeStyleProperties = */ true ); + } + + helper::tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + throw beans::UnknownPropertyException(); + + return (*aFound).second; + // \-- +} + +// ____ OPropertySet ____ +::cppu::IPropertyArrayHelper & SAL_CALL FormattedString::getInfoHelper() +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( + lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + + +// ____ XPropertySet ____ +uno::Reference< beans::XPropertySetInfo > SAL_CALL + FormattedString::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static uno::Reference< beans::XPropertySetInfo > xInfo; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +// ================================================================================ + +using impl::FormattedString_Base; + +IMPLEMENT_FORWARD_XINTERFACE2( FormattedString, FormattedString_Base, ::property::OPropertySet ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( FormattedString, FormattedString_Base, ::property::OPropertySet ) + +// do this in derived classes! + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( FormattedString, + C2U( "com.sun.star.comp.chart.FormattedString" )); + +} // namespace chart diff --git a/chart2/source/model/main/FormattedString.hxx b/chart2/source/model/main/FormattedString.hxx new file mode 100644 index 000000000000..ebbfb2316099 --- /dev/null +++ b/chart2/source/model/main/FormattedString.hxx @@ -0,0 +1,156 @@ +/************************************************************************* + * + * $RCSfile: FormattedString.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_FORMATTEDSTRING_HXX +#define CHART_FORMATTEDSTRING_HXX + +#ifndef CHART_MUTEXCONTAINER_HXX +#include "MutexContainer.hxx" +#endif +#ifndef CHART_OPROPERTYSET_HXX +#include "OPropertySet.hxx" +#endif + +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include <cppuhelper/implbase2.hxx> +#endif +#ifndef _COMPHELPER_UNO3_HXX_ +#include <comphelper/uno3.hxx> +#endif +#include "ServiceMacros.hxx" + +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XFORMATTEDSTRING_HPP_ +#include <drafts/com/sun/star/chart2/XFormattedString.hpp> +#endif + +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif + +namespace chart +{ + +namespace impl +{ +typedef ::cppu::WeakImplHelper2< + ::drafts::com::sun::star::chart2::XFormattedString, + ::com::sun::star::lang::XServiceInfo + > + FormattedString_Base; +} + +class FormattedString : + public helper::MutexContainer, + public impl::FormattedString_Base, + public ::property::OPropertySet +{ +public: + FormattedString( const ::rtl::OUString & rString ); + FormattedString( ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext ); + virtual ~FormattedString(); + + /// declare XServiceInfo methods + APPHELPER_XSERVICEINFO_DECL() + /// establish methods for factory instatiation + APPHELPER_SERVICE_FACTORY_HELPER( FormattedString ) + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +protected: + // ____ XFormattedString ____ + virtual ::rtl::OUString SAL_CALL getString() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setString( const ::rtl::OUString& String ) + throw (::com::sun::star::uno::RuntimeException); + + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + +// virtual sal_Bool SAL_CALL convertFastPropertyValue +// ( ::com::sun::star::uno::Any & rConvertedValue, +// ::com::sun::star::uno::Any & rOldValue, +// sal_Int32 nHandle, +// const ::com::sun::star::uno::Any& rValue ) +// throw (::com::sun::star::lang::IllegalArgumentException); + +private: + ::rtl::OUString m_aString; +}; + +} // namespace chart + +// CHART_FORMATTEDSTRING_HXX +#endif diff --git a/chart2/source/model/main/ImplChartModel.cxx b/chart2/source/model/main/ImplChartModel.cxx new file mode 100644 index 000000000000..8904f4088f34 --- /dev/null +++ b/chart2/source/model/main/ImplChartModel.cxx @@ -0,0 +1,396 @@ +/************************************************************************* + * + * $RCSfile: ImplChartModel.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ImplChartModel.hxx" +#include "CachedDataSequence.hxx" +#include "DataSeries.hxx" +#include "DataInterpreter.hxx" +#include "StyleFamilies.hxx" +#include "StyleFamily.hxx" +#include "macros.hxx" +#include "algohelper.hxx" +#include "ContextHelper.hxx" +#include "TitleHelper.hxx" +// #include "SplitLayoutContainer.hxx" +#include "LayoutDefaults.hxx" +#include "ChartDocumentWrapper.hxx" + +#ifndef _CPPUHELPER_COMPONENT_CONTEXT_HXX_ +#include <cppuhelper/component_context.hxx> +#endif + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDATASINK_HPP_ +#include <drafts/com/sun/star/chart2/XDataSink.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDATASEQUENCE_HPP_ +#include <drafts/com/sun/star/chart2/XDataSequence.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDATASERIES_HPP_ +#include <drafts/com/sun/star/chart2/XDataSeries.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XAXIS_HPP_ +#include <drafts/com/sun/star/chart2/XAxis.hpp> +#endif + +#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_ +#include <com/sun/star/lang/XInitialization.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif + +#include <vector> +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; + +using ::rtl::OUString; + +namespace chart +{ +namespace impl +{ + +ImplChartModel::ImplChartModel( Reference< uno::XComponentContext > const & xContext ) : + m_xContext( xContext ), + m_xChartTypeManager( + xContext->getServiceManager()->createInstanceWithContext( + C2U( "drafts.com.sun.star.chart2.ChartTypeManager" ), + xContext ), uno::UNO_QUERY ) +// m_xLayoutContainer( new SplitLayoutContainer() ) +{ + GetStyleFamilies(); + + + uno::Reference< beans::XPropertySet > xProp( m_xChartTypeManager, uno::UNO_QUERY ); + uno::Reference< lang::XMultiServiceFactory > xFact( m_xChartTypeManager, uno::UNO_QUERY ); + if( xProp.is() && + xFact.is() ) + { + OUString aServiceName; + if( xProp->getPropertyValue( C2U( "ChartStyleTemplateServiceName" )) >>= aServiceName ) + { + m_xChartTypeTemplate.set( xFact->createInstance( aServiceName ), uno::UNO_QUERY ); + } + } +} + +// ImplChartModel::CreateStyles() +// { +// // set style +// Reference< container::XNameAccess > xGraphicsFamily( +// GetStyleFamilies()->getByName( C2U( "graphics" )), uno::UNO_QUERY ); + +// if( xGraphicsFamily.is()) +// const sal_Int32 nModul = Reference< container::XIndexAccess >( +// xGraphicsFamily, uno::UNO_QUERY )->getCount(); +// for( size_t nI = 0; nI < nMaxSeries; ++nI ) +// { +// try +// { +// Reference< ::com::sun::star::style::XStyle > xStyle( +// xGraphicsFamily->getByName( +// aStyleNameStub + OUString::valueOf( +// static_cast< sal_Int32 >( (nI % nModul)+1 ))), uno::UNO_QUERY ); + +// Reference< beans::XPropertySet > xSeriesProp( +// aResult[ nI ], uno::UNO_QUERY ); + +// if( xSeriesProp.is()) +// { +// xSeriesProp->setPropertyValue( +// C2U( "Color" ), +// uno::makeAny( nDefaultColors[ sal_Int32( nI % nMaxDefaultColors ) ])); + +// // set style +// Reference< ::drafts::com::sun::star::style::XStyleSupplier > +// xStyleSupp( xSeriesProp->getPropertyValue( C2U( "FirstGraphicsFormat" )), +// uno::UNO_QUERY ); + +// if( xStyleSupp.is()) +// { +// xStyleSupp->setStyle( xStyle ); +// } +// } +// } +// catch( uno::Exception ex ) +// { +// OSL_ENSURE( false, "Couldn't set style" ); +// } +// } +// } + + +void ImplChartModel::ReadData( const ::rtl::OUString & rRangeRepresentation ) +{ + static sal_Int32 nDefaultColors[] = { + 0xd43b3a, + 0xd0976d, + 0x76934b, + 0x386a53, + 0x14816b, + 0x103841, + 0x12406c, + 0x5929ba, + 0xda42c0, + 0xc179a2, + 0x31181b, + 0x4e6129 + }; + static const sal_Int32 nMaxDefaultColors = sizeof( nDefaultColors ) / sizeof( sal_Int32 ); + + if( m_xDataProvider.is()) + { + m_xChartData = m_xDataProvider->getDataByRangeRepresentation( rRangeRepresentation ); + + // create DataSeries objects using the standard data interpreter + m_aInterpretedData = DataInterpreter::InterpretData( m_xChartData ); + + const size_t nMaxSeries = m_aInterpretedData.size(); + const OUString aStyleNameStub( RTL_CONSTASCII_USTRINGPARAM( "Series " )); + + for( size_t nI = 0; nI < nMaxSeries; ++nI ) + { + try + { + Reference< beans::XPropertySet > xSeriesProp( + m_aInterpretedData[ nI ], uno::UNO_QUERY ); + + if( xSeriesProp.is()) + { + xSeriesProp->setPropertyValue( + C2U( "Color" ), + uno::makeAny( nDefaultColors[ sal_Int32( nI % nMaxDefaultColors ) ])); + } + } + catch( uno::Exception ex ) + { + OSL_ENSURE( false, "Couldn't set style" ); + } + } + } +} + +Reference< container::XNameAccess > ImplChartModel::GetStyleFamilies() +{ + if( ! m_xFamilies.is()) + { +// StyleFamilies * pStyleFamilies = new StyleFamilies(); +// StyleFamily * pGraphicsFamily = new StyleFamily(); +// Reference< container::XNameAccess > xGraphicsFamily( pGraphicsFamily ); + + // add some default styles for graphics + + // randomly generated default colors + +// sal_Int32 i = 0; +// const sal_Int32 nMax = sizeof( nDefaults ) / sizeof( sal_Int32 ); +// for( ; i < nMax; ++i ) +// { +// try +// { +// Reference< ::com::sun::star::style::XStyle > xStyle( +// new GraphicsPropertiesStyle( xGraphicsFamily ) ); +// xStyle->setName( C2U( "Series " ) + OUString::valueOf( static_cast< sal_Int32 >(i + 1) ) ); +// Reference< beans::XPropertySet > xProp( xStyle, uno::UNO_QUERY ); +// if( xProp.is()) +// { +// xProp->setPropertyValue( C2U( "Color" ), uno::makeAny( nDefaults[ i ] )); +// } +// pGraphicsFamily->AddStyle( xStyle ); +// } +// catch( uno::Exception ex ) +// { +// OSL_ENSURE( false, "Error on creating styles" ); +// } +// } + +// bool bResult = pStyleFamilies->AddStyleFamily( +// C2U( "graphics" ), xGraphicsFamily ); + +// OSL_ASSERT( bResult ); +// m_xFamilies.set( pStyleFamilies ); + } + + return m_xFamilies; +} + +// Diagram Access + +void ImplChartModel::RemoveAllDiagrams() +{ + m_aDiagrams.clear(); +} + +bool ImplChartModel::RemoveDiagram( const Reference< chart2::XDiagram > & xDiagram ) +{ + tDiagramContainer::iterator aIt( ::std::find( + m_aDiagrams.begin(), m_aDiagrams.end(), + xDiagram )); + if( aIt == m_aDiagrams.end() ) + return false; + + m_aDiagrams.erase( aIt ); + return true; +} + +void ImplChartModel::AppendDiagram( const Reference< chart2::XDiagram > & xDiagram ) +{ + m_aDiagrams.push_back( xDiagram ); +} + +Reference< chart2::XDiagram > ImplChartModel::GetDiagram( size_t nIndex ) const + throw( container::NoSuchElementException ) +{ + if( nIndex >= m_aDiagrams.size() ) + throw container::NoSuchElementException(); + + return m_aDiagrams[ nIndex ]; +} + +void ImplChartModel::SetDataProvider( + const Reference< chart2::XDataProvider > & xProvider ) +{ + m_xDataProvider = xProvider; + + // release other ressources + m_xChartData = 0; + m_aInterpretedData.clear(); +} + +void SAL_CALL ImplChartModel::SetRangeRepresentation( const ::rtl::OUString& aRangeRepresentation ) + throw (lang::IllegalArgumentException) +{ + OSL_TRACE( ::rtl::OUStringToOString( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Chart Range: \"" )) + + aRangeRepresentation + + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "\"")), + RTL_TEXTENCODING_ASCII_US ).getStr() ); + ReadData( aRangeRepresentation ); + CreateDefaultChart(); +} + +void ImplChartModel::SetChartTypeManager( + const Reference< chart2::XChartTypeManager > & xManager ) +{ + m_xChartTypeManager = xManager; +} + +Reference< chart2::XChartTypeManager > ImplChartModel::GetChartTypeManager() +{ + return m_xChartTypeManager; +} + +void ImplChartModel::SetChartTypeTemplate( + const Reference< chart2::XChartTypeTemplate > & xTemplate ) +{ + m_xChartTypeTemplate = xTemplate; +} + +Reference< chart2::XChartTypeTemplate > ImplChartModel::GetChartTypeTemplate() +{ + return m_xChartTypeTemplate; +} + +void ImplChartModel::CreateDefaultChart() +{ + // clean up + RemoveAllDiagrams(); + + if( GetChartTypeTemplate().is()) + { + AppendDiagram( + GetChartTypeTemplate()->createDiagram( helper::VectorToSequence( m_aInterpretedData ))); + } +} + +uno::Reference< chart2::XTitle > ImplChartModel::GetTitle() +{ + return m_xTitle; +} + +void ImplChartModel::SetTitle( const uno::Reference< chart2::XTitle >& rTitle ) +{ + m_xTitle = rTitle; +} + +uno::Reference< ::com::sun::star::chart::XChartDocument > ImplChartModel::GetOldChartDocument( + const uno::Reference< chart2::XChartDocument > & xNewModel ) +{ + // put weak reference into a strong one + uno::Reference< ::com::sun::star::chart::XChartDocument > xRef( m_xOldModel ); + + if( ! xRef.is()) + { + xRef.set( new wrapper::ChartDocumentWrapper( xNewModel, m_xContext )); + + // assing reference to weak reference + m_xOldModel = xRef; + } + + return xRef; +} + +} // namespace impl +} // namespace chart diff --git a/chart2/source/model/main/ImplChartModel.hxx b/chart2/source/model/main/ImplChartModel.hxx new file mode 100644 index 000000000000..5eaa5aa56c7c --- /dev/null +++ b/chart2/source/model/main/ImplChartModel.hxx @@ -0,0 +1,229 @@ +/************************************************************************* + * + * $RCSfile: ImplChartModel.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_IMPLCHARTMODEL_HXX +#define CHART_IMPLCHARTMODEL_HXX + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDATASOURCE_HPP_ +#include <drafts/com/sun/star/chart2/XDataSource.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDATASERIES_HPP_ +#include <drafts/com/sun/star/chart2/XDataSeries.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDIAGRAM_HPP_ +#include <drafts/com/sun/star/chart2/XDiagram.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDATAPROVIDER_HPP_ +#include <drafts/com/sun/star/chart2/XDataProvider.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTTYPEMANAGER_HPP_ +#include <drafts/com/sun/star/chart2/XChartTypeManager.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTTYPETEMPLATE_HPP_ +#include <drafts/com/sun/star/chart2/XChartTypeTemplate.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTITLE_HPP_ +#include <drafts/com/sun/star/chart2/XTitle.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTDOCUMENT_HPP_ +#include <drafts/com/sun/star/chart2/XChartDocument.hpp> +#endif +// #ifndef _DRAFTS_COM_SUN_STAR_LAYOUT_XSPLITLAYOUTCONTAINER_HPP_ +// #include <drafts/com/sun/star/layout/XSplitLayoutContainer.hpp> +// #endif + +#ifndef _COM_SUN_STAR_CONTAINER_NOSUCHELEMENTEXCEPTION_HPP_ +#include <com/sun/star/container/NoSuchElementException.hpp> +#endif + +#ifndef _COM_SUN_STAR_CHART_XCHARTDOCUMENT_HPP_ +#include <com/sun/star/chart/XChartDocument.hpp> +#endif + +#ifndef _CPPUHELPER_WEAKREF_HXX_ +#include <cppuhelper/weakref.hxx> +#endif + +#include <vector> + +namespace com { namespace sun { namespace star { + namespace container { + class XNameAccess; + } + namespace uno { + class XComponentContext; + } +}}} + +namespace chart +{ +namespace impl +{ + +class ImplChartModel +{ +public: + ImplChartModel( ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext ); + +// ::com::sun::star::uno::Sequence< +// ::com::sun::star::uno::Reference< +// ::drafts::com::sun::star::chart2::XDataSeries > > +// GetDataSeries() const; + + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess > + GetStyleFamilies(); + + // Diagram Access + void RemoveAllDiagrams(); + /** @return true, if the chart was found and removed, false otherwise. + */ + bool RemoveDiagram( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDiagram > & xDiagram ); + void AppendDiagram( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDiagram > & xDiagram ); + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDiagram > + GetDiagram( size_t nIndex ) const + throw( ::com::sun::star::container::NoSuchElementException ); + + void SetDataProvider( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataProvider > & xProvider ); + + void SAL_CALL SetRangeRepresentation( const ::rtl::OUString& aRangeRepresentation ) + throw (::com::sun::star::lang::IllegalArgumentException); + + void SetChartTypeManager( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartTypeManager > & xManager ); + + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartTypeManager > + GetChartTypeManager(); + + void SetChartTypeTemplate( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartTypeTemplate > & xTemplate ); + + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartTypeTemplate > + GetChartTypeTemplate(); + +// void SetSplitLayoutContainer( +// const ::com::sun::star::uno::Reference< +// ::drafts::com::sun::star::layout::XSplitLayoutContainer > & xLayoutCnt ); + +// ::com::sun::star::uno::Reference< +// ::drafts::com::sun::star::layout::XSplitLayoutContainer > GetSplitLayoutContainer(); + + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTitle > + GetTitle(); + + void SetTitle( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XTitle >& rTitle ); + + ::com::sun::star::uno::Reference< + ::com::sun::star::chart::XChartDocument > GetOldChartDocument( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartDocument > & xNewModel ); + +private: + void ReadData( const ::rtl::OUString & rRangeRepresentation ); + void CreateDefaultChart(); +// void CreateDefaultLayout(); + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xFamilies; + + // Data Access (deprecated, temporary solution) + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XDataSource > m_xChartData; + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XDataProvider > m_xDataProvider; + + ::std::vector< ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeries > > m_aInterpretedData; + + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XChartTypeManager > + m_xChartTypeManager; + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XChartTypeTemplate > + m_xChartTypeTemplate; + + // Diagram Access + typedef ::std::vector< ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDiagram > > + tDiagramContainer; + + tDiagramContainer m_aDiagrams; + +// ::com::sun::star::uno::Reference< ::drafts::com::sun::star::layout::XSplitLayoutContainer > +// m_xLayoutContainer; + + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTitle > + m_xTitle; + + ::com::sun::star::uno::WeakReference< ::com::sun::star::chart::XChartDocument > + m_xOldModel; +}; + +} // namespace impl +} // namespace chart + +// CHART_IMPLCHARTMODEL_HXX +#endif diff --git a/chart2/source/model/main/LayoutContainer.cxx b/chart2/source/model/main/LayoutContainer.cxx new file mode 100644 index 000000000000..d4ad05762c68 --- /dev/null +++ b/chart2/source/model/main/LayoutContainer.cxx @@ -0,0 +1,170 @@ +/************************************************************************* + * + * $RCSfile: LayoutContainer.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "LayoutContainer.hxx" +#include "algohelper.hxx" +#include "macros.hxx" + +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +namespace +{ + +static const ::rtl::OUString lcl_aServiceName( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.layout.LayoutContainer" )); +} // anonymous namespace + +namespace chart +{ + +LayoutContainer::LayoutContainer() +{} + +LayoutContainer::~LayoutContainer() +{} + +// ____ XLayoutContainer ____ +void SAL_CALL LayoutContainer::addConstrainedElementByIdentifier( + const ::rtl::OUString& aIdentifier, + const layout::Constraint& Constraint ) + throw (layout::IllegalConstraintException, + lang::IllegalArgumentException, + uno::RuntimeException) +{ + addElementByIdentifier( aIdentifier ); + m_aConstraints[ aIdentifier ] = Constraint; +} + +void SAL_CALL LayoutContainer::addElementByIdentifier( const ::rtl::OUString& aIdentifier ) + throw (lang::IllegalArgumentException, + uno::RuntimeException) +{ + if( ::std::find( m_aLayoutElements.begin(), + m_aLayoutElements.end(), + aIdentifier ) != m_aLayoutElements.end()) + throw lang::IllegalArgumentException(); + + m_aLayoutElements.push_back( aIdentifier ); +} + +void SAL_CALL LayoutContainer::removeElementByIdentifier( const ::rtl::OUString& aIdentifier ) + throw (container::NoSuchElementException, + uno::RuntimeException) +{ + tLayoutElements::iterator aIt( + ::std::find( m_aLayoutElements.begin(), + m_aLayoutElements.end(), + aIdentifier )); + + if( aIt == m_aLayoutElements.end()) + throw container::NoSuchElementException(); + + m_aLayoutElements.erase( aIt ); + m_aConstraints.erase( aIdentifier ); +} + +void SAL_CALL LayoutContainer::setConstraintByIdentifier( + const ::rtl::OUString& aIdentifier, + const layout::Constraint& Constraint ) + throw (container::NoSuchElementException, + uno::RuntimeException) +{ + if( ::std::find( m_aLayoutElements.begin(), + m_aLayoutElements.end(), + aIdentifier ) == m_aLayoutElements.end()) + throw container::NoSuchElementException(); + + m_aConstraints[ aIdentifier ] = Constraint; +} + +layout::Constraint SAL_CALL LayoutContainer::getConstraintByIdentifier( const ::rtl::OUString& aIdentifier ) + throw (container::NoSuchElementException, + uno::RuntimeException) +{ + tConstraintsMap::const_iterator aIt( m_aConstraints.find( aIdentifier )); + if( aIt == m_aConstraints.end()) + throw container::NoSuchElementException(); + + return (*aIt).second; +} + +uno::Sequence< ::rtl::OUString > SAL_CALL LayoutContainer::getElementIdentifiers() + throw (uno::RuntimeException) +{ + return ::chart::helper::VectorToSequence( m_aLayoutElements ); +} + +uno::Sequence< ::rtl::OUString > LayoutContainer::getSupportedServiceNames_Static() +{ + uno::Sequence< ::rtl::OUString > aServices( 1 ); + + aServices[ 0 ] = C2U( "drafts.com.sun.star.layout.LayoutContainer" ); + return aServices; +} + +// -------------------------------------------------------------------------------- + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( LayoutContainer, lcl_aServiceName ); + +} // namespace chart diff --git a/chart2/source/model/main/LayoutContainer.hxx b/chart2/source/model/main/LayoutContainer.hxx new file mode 100644 index 000000000000..0f6255cedb10 --- /dev/null +++ b/chart2/source/model/main/LayoutContainer.hxx @@ -0,0 +1,131 @@ +/************************************************************************* + * + * $RCSfile: LayoutContainer.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_LAYOUTCONTAINER_HXX +#define CHART_LAYOUTCONTAINER_HXX + +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include <cppuhelper/implbase2.hxx> +#endif + +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_LAYOUT_XLAYOUTCONTAINER_HPP_ +#include <drafts/com/sun/star/layout/XLayoutContainer.hpp> +#endif + +#include "ServiceMacros.hxx" + +#include <vector> +#include <map> + +namespace chart +{ + +class LayoutContainer : public + ::cppu::WeakImplHelper2< + ::com::sun::star::lang::XServiceInfo, + ::drafts::com::sun::star::layout::XLayoutContainer > +{ +public: + LayoutContainer(); + virtual ~LayoutContainer(); + + /// XServiceInfo declarations + APPHELPER_XSERVICEINFO_DECL() + +protected: + // ____ XLayoutContainer ____ + virtual void SAL_CALL addConstrainedElementByIdentifier( const ::rtl::OUString& aIdentifier, const ::drafts::com::sun::star::layout::Constraint& Constraint ) + throw (::drafts::com::sun::star::layout::IllegalConstraintException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addElementByIdentifier( const ::rtl::OUString& aIdentifier ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeElementByIdentifier( const ::rtl::OUString& aIdentifier ) + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setConstraintByIdentifier( const ::rtl::OUString& aIdentifier, const ::drafts::com::sun::star::layout::Constraint& Constraint ) + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::uno::RuntimeException); + virtual ::drafts::com::sun::star::layout::Constraint SAL_CALL getConstraintByIdentifier( const ::rtl::OUString& aIdentifier ) + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::rtl::OUString > SAL_CALL getElementIdentifiers() + throw (::com::sun::star::uno::RuntimeException); + +private: + typedef ::std::vector< ::rtl::OUString > tLayoutElements; + + typedef ::std::map< + ::rtl::OUString, + ::drafts::com::sun::star::layout::Constraint > tConstraintsMap; + + tLayoutElements m_aLayoutElements; + tConstraintsMap m_aConstraints; +}; + +} // namespace chart + +// CHART_LAYOUTCONTAINER_HXX +#endif diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx new file mode 100644 index 000000000000..ed041ffac3c7 --- /dev/null +++ b/chart2/source/model/main/Legend.cxx @@ -0,0 +1,263 @@ +/************************************************************************* + * + * $RCSfile: Legend.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Legend.hxx" +#include "macros.hxx" +#include "algohelper.hxx" +#include "LineProperties.hxx" +#include "FillProperties.hxx" +#include "UserDefinedProperties.hxx" +#include "LegendHelper.hxx" + +#ifndef CHART_PROPERTYHELPER_HXX +#include "PropertyHelper.hxx" +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif + +#ifndef _DRAFTS_COM_SUN_STAR_LAYOUT_ALIGNMENT_HPP_ +#include <drafts/com/sun/star/layout/Alignment.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_LAYOUT_STRETCHMODE_HPP_ +#include <drafts/com/sun/star/layout/StretchMode.hpp> +#endif + +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans::PropertyAttribute; +using namespace ::drafts::com::sun::star; + +using ::com::sun::star::beans::Property; + +namespace +{ + +static const ::rtl::OUString lcl_aServiceName( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.Legend" )); + +const uno::Sequence< Property > & lcl_GetPropertySequence() +{ + static uno::Sequence< Property > aPropSeq; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + ::chart::LineProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ false ); + ::chart::FillProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ false ); + ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::helper::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::helper::VectorToSequence( aProperties ); + } + + return aPropSeq; +} + +::cppu::IPropertyArrayHelper & lcl_getInfoHelper() +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( + lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + +} // anonymous namespace + +namespace chart +{ + +Legend::Legend( uno::Reference< uno::XComponentContext > const & xContext ) : + ::property::OPropertySet( m_aMutex ), + m_aIdentifier( LegendHelper::getIdentifierForLegend() ) +{ +} + +Legend::~Legend() +{ +} + +// ____ XLegend ____ +void SAL_CALL Legend::registerEntry( const uno::Reference< chart2::XLegendEntry >& xEntry ) + throw (lang::IllegalArgumentException, + uno::RuntimeException) +{ + if( ::std::find( m_aLegendEntries.begin(), + m_aLegendEntries.end(), + xEntry ) != m_aLegendEntries.end()) + throw lang::IllegalArgumentException(); + + m_aLegendEntries.push_back( xEntry ); +} + +void SAL_CALL Legend::revokeEntry( const uno::Reference< chart2::XLegendEntry >& xEntry ) + throw (container::NoSuchElementException, + uno::RuntimeException) +{ + tLegendEntries::iterator aIt( + ::std::find( m_aLegendEntries.begin(), + m_aLegendEntries.end(), + xEntry )); + + if( aIt == m_aLegendEntries.end()) + throw container::NoSuchElementException(); + + m_aLegendEntries.erase( aIt ); +} + +uno::Sequence< uno::Reference< chart2::XLegendEntry > > SAL_CALL Legend::getEntries() + throw (uno::RuntimeException) +{ + return ::chart::helper::VectorToSequence( m_aLegendEntries ); +} + +::rtl::OUString SAL_CALL Legend::getIdentifier() + throw (uno::RuntimeException) +{ + return m_aIdentifier; +} + +// ================================================================================ + +uno::Sequence< ::rtl::OUString > Legend::getSupportedServiceNames_Static() +{ + uno::Sequence< ::rtl::OUString > aServices( 5 ); + aServices[ 0 ] = C2U( "drafts.com.sun.star.chart2.Legend" ); + aServices[ 1 ] = C2U( "com.sun.star.beans.PropertySet" ); + aServices[ 2 ] = C2U( "com.sun.star.drawing.FillProperties" ); + aServices[ 3 ] = C2U( "com.sun.star.drawing.LineProperties" ); + aServices[ 4 ] = C2U( "drafts.com.sun.star.layout.LayoutElement" ); + return aServices; +} + +// ____ OPropertySet ____ +uno::Any Legend::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static helper::tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + LineProperties::AddDefaultsToMap( + aStaticDefaults, + /* bIncludeStyleProperties = */ false ); + FillProperties::AddDefaultsToMap( + aStaticDefaults, + /* bIncludeStyleProperties = */ false ); + } + + helper::tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + return uno::Any(); + + return (*aFound).second; + // \-- +} + +::cppu::IPropertyArrayHelper & SAL_CALL Legend::getInfoHelper() +{ + return lcl_getInfoHelper(); +} + + +// ____ XPropertySet ____ +uno::Reference< beans::XPropertySetInfo > SAL_CALL + Legend::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static uno::Reference< beans::XPropertySetInfo > xInfo; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( Legend, lcl_aServiceName ); + +// needed by MSC compiler +using impl::Legend_Base; + +IMPLEMENT_FORWARD_XINTERFACE2( Legend, Legend_Base, ::property::OPropertySet ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( Legend, Legend_Base, ::property::OPropertySet ) + +} // namespace chart diff --git a/chart2/source/model/main/Legend.hxx b/chart2/source/model/main/Legend.hxx new file mode 100644 index 000000000000..9bf07b955e63 --- /dev/null +++ b/chart2/source/model/main/Legend.hxx @@ -0,0 +1,182 @@ +/************************************************************************* + * + * $RCSfile: Legend.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_LEGEND_HXX +#define CHART_LEGEND_HXX + +#include "ServiceMacros.hxx" + +#ifndef CHART_OPROPERTYSET_HXX +#include "OPropertySet.hxx" +#endif +#ifndef CHART_MUTEXCONTAINER_HXX +#include "MutexContainer.hxx" +#endif +#ifndef _CPPUHELPER_IMPLBASE4_HXX_ +#include <cppuhelper/implbase4.hxx> +#endif +#ifndef _COMPHELPER_UNO3_HXX_ +#include <comphelper/uno3.hxx> +#endif + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XLEGEND_HPP_ +#include <drafts/com/sun/star/chart2/XLegend.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XIDENTIFIABLE_HPP_ +#include <drafts/com/sun/star/chart2/XIdentifiable.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_LAYOUT_XLAYOUTELEMENT_HPP_ +#include <drafts/com/sun/star/layout/XLayoutElement.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif + +namespace chart +{ + +namespace impl +{ +typedef ::cppu::WeakImplHelper4< + ::drafts::com::sun::star::chart2::XLegend, + ::com::sun::star::lang::XServiceInfo, + ::drafts::com::sun::star::chart2::XIdentifiable, + ::drafts::com::sun::star::layout::XLayoutElement > + Legend_Base; +} + +class Legend : + public helper::MutexContainer, + public impl::Legend_Base, + public ::property::OPropertySet +{ +public: + Legend( ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext ); + virtual ~Legend(); + + /// establish methods for factory instatiation + APPHELPER_SERVICE_FACTORY_HELPER( Legend ) + + /// XServiceInfo declarations + APPHELPER_XSERVICEINFO_DECL() + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +protected: + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + +// virtual sal_Bool SAL_CALL convertFastPropertyValue +// ( ::com::sun::star::uno::Any & rConvertedValue, +// ::com::sun::star::uno::Any & rOldValue, +// sal_Int32 nHandle, +// const ::com::sun::star::uno::Any& rValue ) +// throw (::com::sun::star::lang::IllegalArgumentException); + + // ____ XLegend ____ + virtual void SAL_CALL registerEntry( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XLegendEntry >& xEntry ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL revokeEntry( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XLegendEntry >& xEntry ) + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XLegendEntry > > SAL_CALL getEntries() + throw (::com::sun::star::uno::RuntimeException); + + // ____ XIdentifiable ____ + virtual ::rtl::OUString SAL_CALL getIdentifier() + throw (::com::sun::star::uno::RuntimeException); + + // ____ XLayoutElement ____ + // (empty) + +private: + typedef ::std::vector< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XLegendEntry > > tLegendEntries; + + tLegendEntries m_aLegendEntries; + ::rtl::OUString m_aIdentifier; +}; + +} // namespace chart + +// CHART_LEGEND_HXX +#endif diff --git a/chart2/source/model/main/PolarCoordinateSystem.cxx b/chart2/source/model/main/PolarCoordinateSystem.cxx new file mode 100644 index 000000000000..9f215a97c15d --- /dev/null +++ b/chart2/source/model/main/PolarCoordinateSystem.cxx @@ -0,0 +1,118 @@ +/************************************************************************* + * + * $RCSfile: PolarCoordinateSystem.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2002 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "PolarCoordinateSystem.hxx" +#include "PolarTransformation.hxx" +#include "macros.hxx" + +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::uno::Sequence; +using ::rtl::OUString; + +namespace chart +{ + +PolarCoordinateSystem::PolarCoordinateSystem( sal_Int32 nDim ) : + m_aTransformationToCartesian( + new PolarTransformation( PolarTransformation::TRANSFORM_FROM, nDim ) ), + m_aTransformationFromCartesian( + new PolarTransformation( PolarTransformation::TRANSFORM_TO, nDim ) ), + m_nDim( nDim ) +{ +} + +PolarCoordinateSystem::~PolarCoordinateSystem() +{} + +// ____ XCoordinateSystem ____ +::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation > SAL_CALL + PolarCoordinateSystem::getTransformationToCartesian() + throw (RuntimeException) +{ + return m_aTransformationToCartesian; +} + +::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation > SAL_CALL + PolarCoordinateSystem::getTransformationFromCartesian() + throw (RuntimeException) +{ + return m_aTransformationFromCartesian; +} + +sal_Int32 SAL_CALL PolarCoordinateSystem::getDimension() throw (RuntimeException) +{ + return m_nDim; +} + + +// ____ XServiceInfo ____ + +Sequence< OUString > PolarCoordinateSystem::getSupportedServiceNames_Static() +{ + Sequence< OUString > aServices; +// Sequence< OUString > aServices( 1 ); +// aServices[ 0 ] = C2U( "drafts.com.sun.star.chart2.CoordinateSystem" ); + return aServices; +} + +APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem, + C2U( "com.sun.star.comp.chart.PolarCoordinateSystem" )); + +} // namespace chart diff --git a/chart2/source/model/main/RectangularDataSource.cxx b/chart2/source/model/main/RectangularDataSource.cxx new file mode 100644 index 000000000000..a40f134e9147 --- /dev/null +++ b/chart2/source/model/main/RectangularDataSource.cxx @@ -0,0 +1,335 @@ +/************************************************************************* + * + * $RCSfile: RectangularDataSource.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "RectangularDataSource.hxx" +#include "CachedDataSequence.hxx" +#include "StandardNaNHelper.hxx" + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XNUMERICALDATASEQUENCE_HPP_ +#include <drafts/com/sun/star/chart2/XNumericalDataSequence.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTEXTUALDATASEQUENCE_HPP_ +#include <drafts/com/sun/star/chart2/XTextualDataSequence.hpp> +#endif +#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_ +#include <com/sun/star/util/XNumberFormatsSupplier.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +using ::rtl::OUString; +using ::osl::MutexGuard; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::beans::Property; +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::uno::Any; +using ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT; + +// necessary for MS compiler +using ::comphelper::OPropertyContainer; +using ::chart::impl::RectangularDataSource_Base; + +// ________________________________________ + +// Property-Ids + +namespace +{ +enum +{ + PROP_SOURCE_RANGE, + PROP_DATA_ROW_SOURCE +}; +} // anonymous namespace + + +// ________________________________________ + +namespace chart +{ + +#define STANDARD_PROPERTY_ATTRIBUTES ::com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT + +RectangularDataSource::RectangularDataSource( uno::Reference< uno::XComponentContext > const & xContext ) + : OPropertyContainer( GetBroadcastHelper() ), + RectangularDataSource_Base( GetMutex() ), + m_aDataRowSource( ::com::sun::star::chart::ChartDataRowSource_COLUMNS ) +{ + registerProperty( C2U( "SourceRange" ), + PROP_SOURCE_RANGE, // Handle for fast access + 0, // PropertyAttributes + & m_aSourceRange, // pointer to corresponding member + ::getCppuType( & m_aSourceRange ) // Type of property + ); + + registerProperty( C2U( "DataRowSource" ), + PROP_DATA_ROW_SOURCE, // Handle for fast access + MAYBEDEFAULT, // PropertyAttributes + & m_aDataRowSource, // pointer to corresponding member + ::getCppuType( & m_aDataRowSource ) // Type of property + ); +} + +RectangularDataSource::~RectangularDataSource() +{} + +// base for XServiceInfo +Sequence< OUString > RectangularDataSource::getSupportedServiceNames_Static() +{ + Sequence< OUString > aServices( 4 ); + aServices[ 0 ] = C2U( "drafts.com.sun.star.chart2.RectangularDataSource" ); + aServices[ 1 ] = C2U( "drafts.com.sun.star.chart2.DataFilter" ); + aServices[ 2 ] = C2U( "drafts.com.sun.star.chart2.DataSource" ); + aServices[ 3 ] = C2U( "drafts.com.sun.star.chart2.DataSink" ); + return aServices; +} + +// ____ XDataSink ____ +void SAL_CALL RectangularDataSource::setData( const uno::Sequence< Reference< chart2::XDataSequence > >& aData ) + throw (RuntimeException) +{ + m_aDataSequences = aData; +} + +// ____ XDataSource ____ +uno::Sequence< Reference< chart2::XDataSequence > > SAL_CALL RectangularDataSource::getDataSequences() + throw (RuntimeException) +{ + return m_aDataSequences; +} + +double SAL_CALL RectangularDataSource::getNotANumber() + throw (uno::RuntimeException) +{ + return helper::StandardNaNHelper::getNotANumber(); +} + +sal_Bool SAL_CALL RectangularDataSource::isNotANumber( double fNumber ) + throw (uno::RuntimeException) +{ + return helper::StandardNaNHelper::isNotANumber( fNumber ); +} + +// ____ XIndexAccess ____ + sal_Int32 SAL_CALL RectangularDataSource::getCount() + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return m_aDataSequences.getLength(); + // \-- +} + + Any SAL_CALL RectangularDataSource::getByIndex( sal_Int32 Index ) + throw (lang::IndexOutOfBoundsException, + lang::WrappedTargetException, + RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return uno::makeAny( GetDataByIndex( Index ) ); + // \-- +} + +// ____ XElementAccess (base of XIndexAccess) ____ + uno::Type SAL_CALL RectangularDataSource::getElementType() + throw (RuntimeException) +{ + return ::getCppuType((const Reference< chart2::XDataSequence >*)0); +} + +sal_Bool SAL_CALL RectangularDataSource::hasElements() + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return static_cast< sal_Bool >( m_aDataSequences.getLength() > 0 ); + // \-- +} + +Reference< chart2::XDataSequence > RectangularDataSource::GetDataByIndex( sal_Int32 Index ) const + throw (lang::IndexOutOfBoundsException) +{ + if( 0 > Index || Index >= m_aDataSequences.getLength() ) + throw lang::IndexOutOfBoundsException(); + + return m_aDataSequences.getConstArray() [ Index ]; +} + +void SAL_CALL RectangularDataSource::setFastPropertyValue_NoBroadcast( + sal_Int32 nHandle, + const Any& rValue ) + throw (uno::Exception) +{ + // at this point it is clear that rValue contains a different value than the + // property currently still has, and that it will be overwritten by it in + // the final base class call + + switch( nHandle ) + { + case PROP_DATA_ROW_SOURCE: + { + ::com::sun::star::chart::ChartDataRowSource aRowSource; + if( rValue >>= aRowSource ) + { + if( aRowSource != m_aDataRowSource ) + { + SwapData(); + } + } + } + break; + } + + OPropertyContainer::setFastPropertyValue_NoBroadcast( nHandle, rValue ); +} + +// ================================================================================ + +using impl::RectangularDataSource_Base; + +IMPLEMENT_FORWARD_XINTERFACE2( RectangularDataSource, RectangularDataSource_Base, OPropertyContainer ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( RectangularDataSource, RectangularDataSource_Base, OPropertyContainer ) + +// ____ XPropertySet ____ +Reference< beans::XPropertySetInfo > SAL_CALL RectangularDataSource::getPropertySetInfo() + throw(RuntimeException) +{ + return Reference< beans::XPropertySetInfo >( createPropertySetInfo( getInfoHelper() ) ); +} + +// ____ ::comphelper::OPropertySetHelper ____ +// __________________________________________ +::cppu::IPropertyArrayHelper& RectangularDataSource::getInfoHelper() +{ + return *getArrayHelper(); +} + +// ____ ::comphelper::OPropertyArrayHelper ____ +// ____________________________________________ +::cppu::IPropertyArrayHelper* RectangularDataSource::createArrayHelper() const +{ + Sequence< Property > aProps; + // describes all properties which have been registered in the ctor + describeProperties( aProps ); + + return new ::cppu::OPropertyArrayHelper( aProps ); +} + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( RectangularDataSource, + C2U( "com.sun.star.comp.chart.RectangularDataSource" )) + +void RectangularDataSource::SwapData() +{ + try + { + // assume that there are always text labels + Reference< chart2::XTextualDataSequence > xCategories( GetDataByIndex( 0 ), uno::UNO_QUERY ); + + // -1: the first sequence contains labels + sal_Int32 nNewSequenceSize = m_aDataSequences.getLength() - 1; + if( nNewSequenceSize > 0 ) + { + // +1: one series more for labels + sal_Int32 nNewNumOfSequences = GetDataByIndex( 0 )->getData().getLength() + 1; + Sequence< Reference< chart2::XDataSequence > > aResult( nNewNumOfSequences ); + ::std::vector< OUString > aCategoryVector( nNewSequenceSize ); + sal_Int32 nIdx = 0; + + // fill new categories consisting of former labels + for( nIdx = 0; nIdx < nNewSequenceSize; ++nIdx ) + { + aCategoryVector.push_back( GetDataByIndex( nIdx )->getLabel() ); + } + aResult[ 0 ] = Reference< chart2::XDataSequence >( + static_cast< chart2::XTextualDataSequence * >( + new ::chart::CachedDataSequence( aCategoryVector ))); + + // fill new data sequences. The label is set by the former categories + for( sal_Int32 nSeqIdx = 1; nSeqIdx < nNewNumOfSequences; ++ nSeqIdx ) + { + ::std::vector< double > aDataVector( nNewSequenceSize ); + for( nIdx = 0; nIdx < nNewSequenceSize; ++nIdx ) + { + aDataVector.push_back( + Reference< chart2::XNumericalDataSequence >( + GetDataByIndex( nIdx ), + uno::UNO_QUERY )->getNumericalData().getConstArray()[ nSeqIdx - 1 ] ); + } + aResult[ nSeqIdx ] = Reference< chart2::XDataSequence >( + static_cast< chart2::XNumericalDataSequence * >( + new ::chart::CachedDataSequence( aDataVector ))); + } + + setData( aResult ); + } + } + catch( lang::IndexOutOfBoundsException aEx ) + { + } +} + +} // namespace chart diff --git a/chart2/source/model/main/Style.cxx b/chart2/source/model/main/Style.cxx new file mode 100644 index 000000000000..d93160640609 --- /dev/null +++ b/chart2/source/model/main/Style.cxx @@ -0,0 +1,194 @@ +/************************************************************************* + * + * $RCSfile: Style.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Style.hxx" +#include "macros.hxx" + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif +#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_ +#include <com/sun/star/container/XNameContainer.hpp> +#endif + +using namespace ::com::sun::star; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::RuntimeException; +using ::rtl::OUString; +using ::osl::MutexGuard; + +// necessary for MS compiler +using ::comphelper::OPropertyContainer; +using ::chart::impl::Style_Base; + +namespace +{ +static const ::rtl::OUString lcl_aImplName( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.Style" )); +} // anonymous namespace + +namespace chart +{ + +Style::Style( const Reference< container::XNameContainer > & xStyleFamiliyToAddTo ) : + OPropertyContainer( GetBroadcastHelper()), + Style_Base( GetMutex()), + m_xStyleFamily( xStyleFamiliyToAddTo ), + m_aName( C2U( "Default" ) ), + m_bUserDefined( sal_False ) +{ + OSL_ENSURE( m_xStyleFamily.is(), "No StyleFamily to add style to" ); +} + +Style::~Style() +{} + +sal_Bool SAL_CALL Style::isUserDefined() + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return m_bUserDefined; + // \-- +} + +sal_Bool SAL_CALL Style::isInUse() + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + + // aBoundLC is a member of cppuhelper::OPropertySetHelper + // it is assumed that a style is in use whenever some component is + // registered here as listener + return ( aBoundLC.getContainedTypes().getLength() > 0 ); + // \-- +} + +OUString SAL_CALL Style::getParentStyle() + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return m_aParentStyleName; + // \-- +} + +void SAL_CALL Style::setParentStyle( const OUString& aParentStyle ) + throw (container::NoSuchElementException, + RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + m_aParentStyleName = aParentStyle; + // \-- +} + + +OUString SAL_CALL Style::getName() + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return m_aName; + // \-- +} + +void SAL_CALL Style::setName( const OUString& aName ) + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + OSL_ASSERT( m_xStyleFamily.is()); + + if( m_xStyleFamily.is() ) + { + // remove old name + if( m_aName.getLength() > 0 ) + { + Reference< container::XNameAccess > xAccess( m_xStyleFamily, uno::UNO_QUERY ); + OSL_ASSERT( xAccess.is()); + if( xAccess->hasByName( m_aName )) + m_xStyleFamily->removeByName( m_aName ); + } + + // change name + m_aName = aName; + + // add new name + m_xStyleFamily->insertByName( m_aName, uno::makeAny( this )); + } + // \-- +} + +IMPLEMENT_FORWARD_XINTERFACE2( Style, Style_Base, OPropertyContainer ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( Style, Style_Base, OPropertyContainer ) + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( Style, lcl_aImplName ) + +uno::Sequence< OUString > Style::getSupportedServiceNames_Static() +{ + uno::Sequence< OUString > aServices( 1 ); + aServices[ 0 ] = C2U( "com.sun.star.style.Style" ); + return aServices; +} + +} // namespace chart diff --git a/chart2/source/model/main/Style.hxx b/chart2/source/model/main/Style.hxx new file mode 100644 index 000000000000..957113211ade --- /dev/null +++ b/chart2/source/model/main/Style.hxx @@ -0,0 +1,163 @@ +/************************************************************************* + * + * $RCSfile: Style.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_STYLE_HXX +#define CHART_STYLE_HXX + +// helper classes +#ifndef _CPPUHELPER_COMPBASE2_HXX_ +#include <cppuhelper/compbase2.hxx> +#endif +#ifndef _COMPHELPER_UNO3_HXX_ +#include <comphelper/uno3.hxx> +#endif +#ifndef _COMPHELPER_BROADCASTHELPER_HXX_ +#include <comphelper/broadcasthelper.hxx> +#endif +#ifndef _COMPHELPER_PROPERTYCONTAINER_HXX_ +#include <comphelper/propertycontainer.hxx> +#endif +#ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_ +#include <comphelper/proparrhlp.hxx> +#endif + +#include "ServiceMacros.hxx" + +// interfaces and types +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +#ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_ +#include <com/sun/star/style/XStyle.hpp> +#endif + +namespace com { namespace sun { namespace star { namespace container { + class XNameContainer; +}}}} + +namespace chart +{ + +namespace impl +{ +typedef ::cppu::WeakComponentImplHelper2< + ::com::sun::star::style::XStyle, + ::com::sun::star::lang::XServiceInfo > Style_Base; +} + +class Style : + public ::comphelper::OMutexAndBroadcastHelper, + public ::comphelper::OPropertyContainer, + public ::comphelper::OPropertyArrayUsageHelper< Style >, + public impl::Style_Base +{ +public: + Style( const ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameContainer > & xStyleFamiliyToAddTo ); + virtual ~Style(); + + void RegisterProperties( + const ::std::vector< ::com::sun::star::beans::Property > & rProperties, + ::std::vector< ::com::sun::star::uno::Any > & rOutProperties ); + + /// declare XServiceInfo methods + APPHELPER_XSERVICEINFO_DECL() + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +protected: + // ____ style::XStyle ____ + virtual sal_Bool SAL_CALL isUserDefined() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isInUse() throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getParentStyle() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setParentStyle( const ::rtl::OUString& aParentStyle ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + + // ____ container::XNamed (base of XStyle) ____ + virtual ::rtl::OUString SAL_CALL getName() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException); + + // ____ beans::XPropertySet ____ + /// @see ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + /// @see ::comphelper::OPropertySetHelper + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + /// @see ::comphelper::OPropertyArrayUsageHelper + virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const; + +private: + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameContainer > m_xStyleFamily; + + ::rtl::OUString m_aName; + ::rtl::OUString m_aParentStyleName; + sal_Bool m_bUserDefined; +}; + +} // namespace chart + +// CHART_STYLE_HXX +#endif diff --git a/chart2/source/model/main/StyleFamilies.cxx b/chart2/source/model/main/StyleFamilies.cxx new file mode 100644 index 000000000000..48627b536b43 --- /dev/null +++ b/chart2/source/model/main/StyleFamilies.cxx @@ -0,0 +1,207 @@ +/************************************************************************* + * + * $RCSfile: StyleFamilies.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "StyleFamilies.hxx" +#include "macros.hxx" + +#include <algorithm> +#include <functional> + +using namespace ::com::sun::star; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::uno::Sequence; +using ::rtl::OUString; +using ::osl::MutexGuard; + +namespace chart +{ + +StyleFamilies::StyleFamilies() +{ +} + +StyleFamilies::~StyleFamilies() +{} + +bool StyleFamilies::AddStyleFamily( + const OUString & rName, + const Reference< container::XNameAccess > & rFamily ) +{ + if( m_aStyleFamilies.find( rName ) == m_aStyleFamilies.end() ) + { + m_aStyleFamilies[ rName ] = rFamily; + return true; + } + + return false; +} + +// container::XNameAccess +Any SAL_CALL StyleFamilies::getByName( const OUString& aName ) + throw (container::NoSuchElementException, + lang::WrappedTargetException, + RuntimeException) +{ + // /-- + MutexGuard aGuard( m_aMutex ); + + tStyleFamilyContainer::const_iterator aIt( m_aStyleFamilies.find( aName )); + if( aIt == m_aStyleFamilies.end()) + { + throw container::NoSuchElementException( + aName, + static_cast< ::cppu::OWeakObject* >( this )); + } + + OSL_ASSERT( (*aIt).first.equals( aName )); + return uno::makeAny( (*aIt).second ); + // \-- +} + +uno::Sequence< OUString > SAL_CALL StyleFamilies::getElementNames() + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( m_aMutex ); + Sequence< OUString > aResult( m_aStyleFamilies.size()); + + ::std::transform( m_aStyleFamilies.begin(), m_aStyleFamilies.end(), + aResult.getArray(), + ::std::select1st< tStyleFamilyContainer::value_type >() ); + + return aResult; + // \-- +} + +sal_Bool SAL_CALL StyleFamilies::hasByName( const OUString& aName ) + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( m_aMutex ); + + return ( m_aStyleFamilies.find( aName ) != m_aStyleFamilies.end() ); + // \-- +} + + +// container::XIndexAccess (optional) +sal_Int32 SAL_CALL StyleFamilies::getCount() + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( m_aMutex ); + return m_aStyleFamilies.size(); + // \-- +} + +Any SAL_CALL StyleFamilies::getByIndex( sal_Int32 Index ) + throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, RuntimeException) +{ + // /-- + MutexGuard aGuard( m_aMutex ); + tStyleFamilyContainer::const_iterator aIt( m_aStyleFamilies.begin()); + sal_Int32 nCounter = 0; + for( ; + ( nCounter < Index ) && ( aIt != m_aStyleFamilies.end()); + ++nCounter, ++aIt ); + + if( aIt == m_aStyleFamilies.end()) + { + throw container::NoSuchElementException( + OUString::valueOf( Index ), + static_cast< ::cppu::OWeakObject* >( this )); + } + + return uno::makeAny( (*aIt).second ); + // \-- +} + + +// container::XElementAccess (base of XNameAccess and XIndexAccess) +uno::Type SAL_CALL StyleFamilies::getElementType() + throw (RuntimeException) +{ + return ::getCppuType( reinterpret_cast< Reference< container::XNameAccess > * >(0)); +} + +sal_Bool SAL_CALL StyleFamilies::hasElements() + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( m_aMutex ); + return ! m_aStyleFamilies.empty(); + // \-- +} + +// lang::XServiceInfo + +APPHELPER_XSERVICEINFO_IMPL( StyleFamilies, C2U( "com.sun.star.comp.chart2.StyleFamilies" )) + +Sequence< OUString > StyleFamilies::getSupportedServiceNames_Static() +{ + uno::Sequence< OUString > aServices( 1 ); + aServices[ 0 ] = C2U( "com.sun.star.style.StyleFamilies" ); + + return aServices; +} + +} // namespace chart diff --git a/chart2/source/model/main/StyleFamilies.hxx b/chart2/source/model/main/StyleFamilies.hxx new file mode 100644 index 000000000000..d22a9ce49d18 --- /dev/null +++ b/chart2/source/model/main/StyleFamilies.hxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * $RCSfile: StyleFamilies.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_STYLEFAMILIES_HXX +#define CHART_STYLEFAMILIES_HXX + +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include <cppuhelper/implbase2.hxx> +#endif +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif + +#include "ServiceMacros.hxx" + +#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ +#include <com/sun/star/container/XNameAccess.hpp> +#endif +#ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_ +#include <com/sun/star/container/XIndexAccess.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif + +#include <map> + +namespace chart +{ + +class StyleFamilies : public ::cppu::WeakImplHelper2 < + ::com::sun::star::container::XNameAccess, + ::com::sun::star::lang::XServiceInfo > +{ +public: + StyleFamilies(); + virtual ~StyleFamilies(); + + /** adds a style family. + + @param rName the name under which the family can later be accessed + through the XNameAccess. + + @param rFamily the style family object supporting the service + ::com::sun::star::style::StyleFamily. + + @return true, if the family was added. In case there already exists a + family with the name given in rName, nothing is done and false + is returned. + */ + bool AddStyleFamily( + const ::rtl::OUString & rName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess > & rFamily ); + +protected: + // container::XNameAccess + // + // Note: The elements within this collection are StyleFamily instances. + // (only mandatory interface: XNameAccess) + virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException); + + // container::XIndexAccess (optional) + virtual sal_Int32 SAL_CALL getCount() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + // container::XElementAccess (base of XNameAccess and XIndexAccess) + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() throw (::com::sun::star::uno::RuntimeException); + + APPHELPER_XSERVICEINFO_DECL() + + typedef ::std::map< ::rtl::OUString, + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameAccess > > + tStyleFamilyContainer; + +private: + tStyleFamilyContainer m_aStyleFamilies; + ::osl::Mutex m_aMutex; +}; + +} // namespace chart + +// CHART_STYLEFAMILIES_HXX +#endif diff --git a/chart2/source/model/main/StyleFamily.cxx b/chart2/source/model/main/StyleFamily.cxx new file mode 100644 index 000000000000..29b246a2f50e --- /dev/null +++ b/chart2/source/model/main/StyleFamily.cxx @@ -0,0 +1,298 @@ +/************************************************************************* + * + * $RCSfile: StyleFamily.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "StyleFamily.hxx" +#include "macros.hxx" + +#ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_ +#include <com/sun/star/style/XStyle.hpp> +#endif + +#include <algorithm> +#include <functional> + +using namespace ::com::sun::star; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::uno::Sequence; +using ::rtl::OUString; +using ::osl::MutexGuard; + +namespace chart +{ + +StyleFamily::StyleFamily() +{} + +StyleFamily::~StyleFamily() +{} + +bool StyleFamily::AddStyle( + const Reference< style::XStyle > & rStyle ) +{ + bool bRet = false; + + if( rStyle.is()) + { + OUString aName( rStyle->getName() ); + m_aStyles[ aName ] = rStyle; + bRet = true; + } + + return bRet; +} + +// container::XNameAccess (also base of XNameReplace) +uno::Any SAL_CALL StyleFamily::getByName( const OUString& aName ) + throw (container::NoSuchElementException, + lang::WrappedTargetException, + RuntimeException) +{ + // /-- + MutexGuard aGuard( m_aMutex ); + + tStyleContainer::const_iterator aIt( m_aStyles.find( aName )); + if( aIt == m_aStyles.end()) + { + throw container::NoSuchElementException( + aName, + static_cast< ::cppu::OWeakObject* >( this )); + } + + OSL_ASSERT( (*aIt).first.equals( aName )); + return uno::makeAny( (*aIt).second ); + // \-- +} + +Sequence< OUString > SAL_CALL StyleFamily::getElementNames() + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( m_aMutex ); + Sequence< OUString > aResult( m_aStyles.size()); + + ::std::transform( m_aStyles.begin(), m_aStyles.end(), + aResult.getArray(), + ::std::select1st< tStyleContainer::value_type >() ); + + return aResult; + // \-- +} + +sal_Bool SAL_CALL StyleFamily::hasByName( const OUString& aName ) + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( m_aMutex ); + + return ( m_aStyles.find( aName ) != m_aStyles.end() ); + // \-- +} + + +// container::XNameContainer (optional) +void SAL_CALL StyleFamily::insertByName( const OUString& aName, const uno::Any& aElement ) + throw (lang::IllegalArgumentException, + container::ElementExistException, + lang::WrappedTargetException, + RuntimeException) +{ + uno::Reference< style::XStyle > xStyle; + if( aElement >>= xStyle ) + { + // /-- + MutexGuard aGuard( m_aMutex ); + if( m_aStyles.find( aName ) != m_aStyles.end() ) + { + throw container::ElementExistException( + aName, + static_cast< ::cppu::OWeakObject* >( this ) ); + } + + m_aStyles[ aName ] = xStyle; + // \-- + } + else + { + throw lang::IllegalArgumentException( + aName, + static_cast< ::cppu::OWeakObject* >( this ), + 1 /* index */ ); + } +} + +void SAL_CALL StyleFamily::removeByName( const OUString& Name ) + throw (container::NoSuchElementException, + lang::WrappedTargetException, + RuntimeException) +{ + // /-- + MutexGuard aGuard( m_aMutex ); + tStyleContainer::iterator aIt( m_aStyles.find( Name )); + if( aIt == m_aStyles.end()) + { + throw container::NoSuchElementException( + Name, + static_cast< ::cppu::OWeakObject* >( this ) ); + } + + m_aStyles.erase( aIt ); + // \-- +} + + +// container::XIndexAccess (optional) +sal_Int32 SAL_CALL StyleFamily::getCount() + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( m_aMutex ); + return m_aStyles.size(); + // \-- +} + +uno::Any SAL_CALL StyleFamily::getByIndex( sal_Int32 Index ) + throw (lang::IndexOutOfBoundsException, + lang::WrappedTargetException, + RuntimeException) +{ + // /-- + MutexGuard aGuard( m_aMutex ); + tStyleContainer::const_iterator aIt( m_aStyles.begin()); + sal_Int32 nCounter = 0; + for( ; + ( nCounter < Index ) && ( aIt != m_aStyles.end()); + ++nCounter, ++aIt ); + + if( aIt == m_aStyles.end()) + { + throw container::NoSuchElementException( + OUString::valueOf( Index ), + static_cast< ::cppu::OWeakObject* >( this )); + } + + return uno::makeAny( (*aIt).second ); + // \-- +} + + +// container::XElementAccess (base of XNameAccess and XIndexAccess) +uno::Type SAL_CALL StyleFamily::getElementType() + throw (RuntimeException) +{ + return ::getCppuType( reinterpret_cast< Reference< style::XStyle > * >(0)); +} + +sal_Bool SAL_CALL StyleFamily::hasElements() + throw (RuntimeException) +{ + // /-- + MutexGuard aGuard( m_aMutex ); + return ! m_aStyles.empty(); + // \-- +} + + +// container::XNameReplace +void SAL_CALL StyleFamily::replaceByName( const OUString& aName, const uno::Any& aElement ) + throw (lang::IllegalArgumentException, + container::NoSuchElementException, + lang::WrappedTargetException, + RuntimeException) +{ + uno::Reference< style::XStyle > xStyle; + if( aElement >>= xStyle ) + { + // /-- + MutexGuard aGuard( m_aMutex ); + tStyleContainer::const_iterator aIt( m_aStyles.begin()); + if( aIt == m_aStyles.end()) + { + throw container::NoSuchElementException( + aName, + static_cast< ::cppu::OWeakObject* >( this ) ); + } + + m_aStyles[ aName ] = xStyle; + // \-- + } + else + { + throw lang::IllegalArgumentException( + aName, + static_cast< ::cppu::OWeakObject* >( this ), + 1 /* index */ ); + } +} + +// lang::XServiceInfo + +APPHELPER_XSERVICEINFO_IMPL( StyleFamily, C2U( "com.sun.star.comp.chart2.StyleFamily" )) + +Sequence< OUString > StyleFamily::getSupportedServiceNames_Static() +{ + uno::Sequence< OUString > aServices( 1 ); + aServices[ 0 ] = C2U( "com.sun.star.style.StyleFamily" ); + + return aServices; +} + +} // namespace chart diff --git a/chart2/source/model/main/StyleFamily.hxx b/chart2/source/model/main/StyleFamily.hxx new file mode 100644 index 000000000000..4531bce34b63 --- /dev/null +++ b/chart2/source/model/main/StyleFamily.hxx @@ -0,0 +1,159 @@ +/************************************************************************* + * + * $RCSfile: StyleFamily.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_STYLEFAMILY_HXX +#define CHART_STYLEFAMILY_HXX + +#ifndef _CPPUHELPER_IMPLBASE3_HXX_ +#include <cppuhelper/implbase3.hxx> +#endif +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif + +#include "ServiceMacros.hxx" + +#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ +#include <com/sun/star/container/XNameAccess.hpp> +#endif +#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_ +#include <com/sun/star/container/XNameContainer.hpp> +#endif +#ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_ +#include <com/sun/star/container/XIndexAccess.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif + +#include <map> + +namespace com { namespace sun { namespace star { + namespace style { + class XStyle; + } +}}} + +namespace chart +{ + +class StyleFamily : public + ::cppu::WeakImplHelper3< + ::com::sun::star::container::XNameContainer, + ::com::sun::star::container::XIndexAccess, + ::com::sun::star::lang::XServiceInfo + > +{ +public: + StyleFamily(); + virtual ~StyleFamily(); + + /** adds a style. + + @param rStyle the style object supporting the service + ::com::sun::star::style::Style. The name under which this object + can be accessed through XNameAccess is the one you get from + XNamed::getName() (XNamed is a base interface for XStyle.) + + @return true, if the style was added. In case there already exists a + style with the name given in getName(), nothing is done and + false is returned. + */ + bool AddStyle( const ::com::sun::star::uno::Reference< + ::com::sun::star::style::XStyle > & rStyle ); + +protected: + + // container::XNameAccess (also base of XNameReplace) + virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException); + + // container::XNameContainer (optional, base of XNameReplace) + virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + // container::XIndexAccess (optional) + virtual sal_Int32 SAL_CALL getCount() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + // container::XElementAccess (base of XNameAccess and XIndexAccess) + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() throw (::com::sun::star::uno::RuntimeException); + + // container::XNameReplace (base of XNameAccess) + virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + APPHELPER_XSERVICEINFO_DECL() + + typedef ::std::map< ::rtl::OUString, + ::com::sun::star::uno::Reference< + ::com::sun::star::style::XStyle > > + tStyleContainer; + +private: + tStyleContainer m_aStyles; + ::osl::Mutex m_aMutex; +}; + +} // namespace chart + +// CHART_STYLEFAMILY_HXX +#endif diff --git a/chart2/source/model/main/Title.cxx b/chart2/source/model/main/Title.cxx new file mode 100644 index 000000000000..a449346f899f --- /dev/null +++ b/chart2/source/model/main/Title.cxx @@ -0,0 +1,393 @@ +/************************************************************************* + * + * $RCSfile: Title.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Title.hxx" +#include "macros.hxx" +#include "algohelper.hxx" +#include "FormattedString.hxx" +#include "LineProperties.hxx" +#include "FillProperties.hxx" + +#ifndef CHART_PROPERTYHELPER_HXX +#include "PropertyHelper.hxx" +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif + +#ifndef _COM_SUN_STAR_STYLE_PARAGRAPHADJUST_HPP_ +#include <com/sun/star/style/ParagraphAdjust.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_FILLSTYLE_HPP_ +#include <com/sun/star/drawing/FillStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_LINESTYLE_HPP_ +#include <com/sun/star/drawing/LineStyle.hpp> +#endif + +#ifndef _RTL_UUID_H_ +#include <rtl/uuid.h> +#endif +#ifndef _CPPUHELPER_QUERYINTERFACE_HXX_ +#include <cppuhelper/queryinterface.hxx> +#endif + +#include <vector> +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans::PropertyAttribute; +using namespace ::drafts::com::sun::star; + +using ::com::sun::star::beans::Property; +using ::osl::MutexGuard; + +namespace +{ + +static const ::rtl::OUString lcl_aServiceName( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.Title" )); + +enum +{ + PROP_TITLE_PARA_ADJUST, + PROP_TITLE_PARA_LAST_LINE_ADJUST, + PROP_TITLE_PARA_LEFT_MARGIN, + PROP_TITLE_PARA_RIGHT_MARGIN, + PROP_TITLE_PARA_TOP_MARGIN, + PROP_TITLE_PARA_BOTTOM_MARGIN, + PROP_TITLE_PARA_IS_HYPHENATION, + + PROP_TITLE_TEXT_ROTATION, + PROP_TITLE_TEXT_STACKED +}; + +void lcl_AddPropertiesToVector( + ::std::vector< Property > & rOutProperties ) +{ + rOutProperties.push_back( + Property( C2U( "ParaAdjust" ), + PROP_TITLE_PARA_ADJUST, + ::getCppuType( reinterpret_cast< ::com::sun::star::style::ParagraphAdjust * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "ParaLastLineAdjust" ), + PROP_TITLE_PARA_LAST_LINE_ADJUST, + ::getCppuType( reinterpret_cast< sal_Int16 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "ParaLeftMargin" ), + PROP_TITLE_PARA_LEFT_MARGIN, + ::getCppuType( reinterpret_cast< sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "ParaRightMargin" ), + PROP_TITLE_PARA_RIGHT_MARGIN, + ::getCppuType( reinterpret_cast< sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "ParaTopMargin" ), + PROP_TITLE_PARA_TOP_MARGIN, + ::getCppuType( reinterpret_cast< sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "ParaBottomMargin" ), + PROP_TITLE_PARA_BOTTOM_MARGIN, + ::getCppuType( reinterpret_cast< sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "ParaIsHyphenation" ), + PROP_TITLE_PARA_IS_HYPHENATION, + ::getBooleanCppuType(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "TextRotation" ), + PROP_TITLE_TEXT_ROTATION, + ::getCppuType( reinterpret_cast< const double * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + rOutProperties.push_back( + Property( C2U( "StackCharacters" ), + PROP_TITLE_TEXT_STACKED, + ::getBooleanCppuType(), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); +} + +void lcl_AddDefaultsToMap( + ::chart::helper::tPropertyValueMap & rOutMap ) +{ + // ParagraphProperties + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_TITLE_PARA_ADJUST )); + rOutMap[ PROP_TITLE_PARA_ADJUST ] = + uno::makeAny( ::com::sun::star::style::ParagraphAdjust_CENTER ); + // PROP_TITLE_PARA_LAST_LINE_ADJUST + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_TITLE_PARA_LEFT_MARGIN )); + rOutMap[ PROP_TITLE_PARA_LEFT_MARGIN ] = + uno::makeAny( sal_Int32( 0 )); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_TITLE_PARA_RIGHT_MARGIN )); + rOutMap[ PROP_TITLE_PARA_RIGHT_MARGIN ] = + uno::makeAny( sal_Int32( 0 )); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_TITLE_PARA_TOP_MARGIN )); + rOutMap[ PROP_TITLE_PARA_TOP_MARGIN ] = + uno::makeAny( sal_Int32( 0 )); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_TITLE_PARA_BOTTOM_MARGIN )); + rOutMap[ PROP_TITLE_PARA_BOTTOM_MARGIN ] = + uno::makeAny( sal_Int32( 0 )); + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_TITLE_PARA_IS_HYPHENATION )); + rOutMap[ PROP_TITLE_PARA_IS_HYPHENATION ] = + uno::makeAny( sal_True ); + + // own properties + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_TITLE_TEXT_ROTATION )); + rOutMap[ PROP_TITLE_TEXT_ROTATION ] = + uno::makeAny( double( 0.0 ) ); + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_TITLE_TEXT_STACKED )); + rOutMap[ PROP_TITLE_TEXT_STACKED ] = + uno::makeAny( sal_Bool( sal_False ) ); + + // override other defaults + rOutMap[ ::chart::FillProperties::PROP_FILL_STYLE ] = + uno::makeAny( drawing::FillStyle_NONE ); + rOutMap[ ::chart::LineProperties::PROP_LINE_STYLE ] = + uno::makeAny( drawing::LineStyle_NONE ); +} + +const uno::Sequence< Property > & lcl_GetPropertySequence() +{ + static uno::Sequence< Property > aPropSeq; + + // /-- + MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + lcl_AddPropertiesToVector( aProperties ); + ::chart::LineProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ true ); + ::chart::FillProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ true ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::helper::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::helper::VectorToSequence( aProperties ); + } + + return aPropSeq; +} + +::cppu::IPropertyArrayHelper & lcl_getInfoHelper() +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( + lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + +} // anonymous namespace + +// ================================================================================ + +namespace chart +{ + +Title::Title( uno::Reference< uno::XComponentContext > const & xContext ) : + ::property::OPropertySet( m_aMutex ) +{ + if( ! ( xContext->getValueByName( C2U( "Identifier" )) >>= m_aIdentifier )) + { + OSL_ENSURE( false, "Missing Title identifier" ); + } +} + +Title::~Title() +{} + +// -------------------------------------------------------------------------------- + +// ____ XTitle ____ +uno::Sequence< uno::Reference< chart2::XFormattedString > > SAL_CALL Title::getText() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return m_aStrings; + // \-- +} + +void SAL_CALL Title::setText( const uno::Sequence< uno::Reference< chart2::XFormattedString > >& Strings ) + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + m_aStrings = Strings; + // \-- +} + +// ____ XIdentifiable ____ +::rtl::OUString SAL_CALL Title::getIdentifier() + throw (uno::RuntimeException) +{ + return m_aIdentifier; +} + +// ================================================================================ + +// ____ OPropertySet ____ +uno::Any Title::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static helper::tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + LineProperties::AddDefaultsToMap( + aStaticDefaults, + /* bIncludeStyleProperties = */ true ); + FillProperties::AddDefaultsToMap( + aStaticDefaults, + /* bIncludeStyleProperties = */ true ); + + // initialize defaults + // Note: this should be last to override defaults of the previously + // added defaults + lcl_AddDefaultsToMap( aStaticDefaults ); + } + + helper::tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + return uno::Any(); + + return (*aFound).second; + // \-- +} + +::cppu::IPropertyArrayHelper & SAL_CALL Title::getInfoHelper() +{ + return lcl_getInfoHelper(); +} + + +// ____ XPropertySet ____ +uno::Reference< beans::XPropertySetInfo > SAL_CALL + Title::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static uno::Reference< beans::XPropertySetInfo > xInfo; + + // /-- + MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +// ================================================================================ + +uno::Sequence< ::rtl::OUString > Title::getSupportedServiceNames_Static() +{ + uno::Sequence< ::rtl::OUString > aServices( 4 ); + aServices[ 0 ] = C2U( "drafts.com.sun.star.chart2.Title" ); + aServices[ 1 ] = C2U( "com.sun.star.style.ParagraphProperties" ); + aServices[ 2 ] = C2U( "com.sun.star.beans.PropertySet" ); + aServices[ 3 ] = C2U( "drafts.com.sun.star.layout.LayoutElement" ); + return aServices; +} + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( Title, lcl_aServiceName ); + +// needed by MSC compiler +using impl::Title_Base; + +IMPLEMENT_FORWARD_XINTERFACE2( Title, Title_Base, ::property::OPropertySet ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( Title, Title_Base, ::property::OPropertySet ) + +} // namespace chart diff --git a/chart2/source/model/main/Title.hxx b/chart2/source/model/main/Title.hxx new file mode 100644 index 000000000000..c86dc2f8d1d0 --- /dev/null +++ b/chart2/source/model/main/Title.hxx @@ -0,0 +1,177 @@ +/************************************************************************* + * + * $RCSfile: Title.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_TITLE_HXX +#define CHART_TITLE_HXX + +#include "ServiceMacros.hxx" + +#ifndef CHART_OPROPERTYSET_HXX +#include "OPropertySet.hxx" +#endif +#ifndef CHART_MUTEXCONTAINER_HXX +#include "MutexContainer.hxx" +#endif +#ifndef _CPPUHELPER_IMPLBASE4_HXX_ +#include <cppuhelper/implbase4.hxx> +#endif +#ifndef _COMPHELPER_UNO3_HXX_ +#include <comphelper/uno3.hxx> +#endif + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTITLE_HPP_ +#include <drafts/com/sun/star/chart2/XTitle.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XIDENTIFIABLE_HPP_ +#include <drafts/com/sun/star/chart2/XIdentifiable.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_LAYOUT_XLAYOUTELEMENT_HPP_ +#include <drafts/com/sun/star/layout/XLayoutElement.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif + +namespace chart +{ + +namespace impl +{ +typedef ::cppu::WeakImplHelper4< + ::drafts::com::sun::star::chart2::XTitle, + ::com::sun::star::lang::XServiceInfo, + ::drafts::com::sun::star::chart2::XIdentifiable, + ::drafts::com::sun::star::layout::XLayoutElement > + Title_Base; +} + +class Title : + public helper::MutexContainer, + public impl::Title_Base, + public ::property::OPropertySet +{ +public: + Title( ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext ); + virtual ~Title(); + + /// establish methods for factory instatiation + APPHELPER_SERVICE_FACTORY_HELPER( Title ) + + /// XServiceInfo declarations + APPHELPER_XSERVICEINFO_DECL() + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +protected: + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + +// virtual sal_Bool SAL_CALL convertFastPropertyValue +// ( ::com::sun::star::uno::Any & rConvertedValue, +// ::com::sun::star::uno::Any & rOldValue, +// sal_Int32 nHandle, +// const ::com::sun::star::uno::Any& rValue ) +// throw (::com::sun::star::lang::IllegalArgumentException); + + // ____ XTitle ____ + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XFormattedString > > SAL_CALL getText() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setText( const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XFormattedString > >& Strings ) + throw (::com::sun::star::uno::RuntimeException); + + // ____ XIdentifiable ____ + virtual ::rtl::OUString SAL_CALL getIdentifier() + throw (::com::sun::star::uno::RuntimeException); + + // ____ XLayoutElement ____ + // (empty) + +private: + ::rtl::OUString m_aIdentifier; + + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XFormattedString > > m_aStrings; +}; + +} // namespace chart + +// CHART_TITLE_HXX +#endif diff --git a/chart2/source/model/main/Wall.cxx b/chart2/source/model/main/Wall.cxx new file mode 100644 index 000000000000..4de963bd771c --- /dev/null +++ b/chart2/source/model/main/Wall.cxx @@ -0,0 +1,256 @@ +/************************************************************************* + * + * $RCSfile: Wall.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Wall.hxx" +#include "macros.hxx" +#include "algohelper.hxx" +#include "LineProperties.hxx" +#include "FillProperties.hxx" +#include "UserDefinedProperties.hxx" + +#ifndef CHART_PROPERTYHELPER_HXX +#include "PropertyHelper.hxx" +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif + +#ifndef _COM_SUN_STAR_DRAWING_FILLSTYLE_HPP_ +#include <com/sun/star/drawing/FillStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_AWT_GRADIENT_HPP_ +#include <com/sun/star/awt/Gradient.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_HATCH_HPP_ +#include <com/sun/star/drawing/Hatch.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_TRANSPARENCYSTYLE_HPP_ +#include <drafts/com/sun/star/chart2/TransparencyStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_LINESTYLE_HPP_ +#include <com/sun/star/drawing/LineStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_LINEDASH_HPP_ +#include <com/sun/star/drawing/LineDash.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_LINEJOINT_HPP_ +#include <com/sun/star/drawing/LineJoint.hpp> +#endif + +#ifndef _RTL_UUID_H_ +#include <rtl/uuid.h> +#endif +#ifndef _CPPUHELPER_QUERYINTERFACE_HXX_ +#include <cppuhelper/queryinterface.hxx> +#endif + +#include <vector> +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans::PropertyAttribute; +using namespace ::drafts::com::sun::star; + +using ::com::sun::star::beans::Property; +using ::osl::MutexGuard; + +namespace +{ + +static const ::rtl::OUString lcl_aServiceName( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart2.Wall" )); + +const uno::Sequence< Property > & lcl_GetPropertySequence() +{ + static uno::Sequence< Property > aPropSeq; + + // /-- + MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + ::chart::LineProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ true ); + ::chart::FillProperties::AddPropertiesToVector( + aProperties, /* bIncludeStyleProperties = */ true ); + ::chart::UserDefinedProperties::AddPropertiesToVector( aProperties ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::helper::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::helper::VectorToSequence( aProperties ); + } + + return aPropSeq; +} + +::cppu::IPropertyArrayHelper & lcl_getInfoHelper() +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( + lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + +} // anonymous namespace + +// ================================================================================ + +namespace chart +{ + +Wall::Wall() : + ::property::OPropertySet( m_aMutex ) +{} + +Wall::~Wall() +{} + +// ================================================================================ + +// ____ OPropertySet ____ +uno::Any Wall::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static helper::tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + // initialize defaults + LineProperties::AddDefaultsToMap( + aStaticDefaults, + /* bIncludeStyleProperties = */ true ); + FillProperties::AddDefaultsToMap( + aStaticDefaults, + /* bIncludeStyleProperties = */ true ); + } + + helper::tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + return uno::Any(); + + return (*aFound).second; + // \-- +} + +::cppu::IPropertyArrayHelper & SAL_CALL Wall::getInfoHelper() +{ + return lcl_getInfoHelper(); +} + + +// ____ XPropertySet ____ +uno::Reference< beans::XPropertySetInfo > SAL_CALL + Wall::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static uno::Reference< beans::XPropertySetInfo > xInfo; + + // /-- + MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +// ____ XInterface ____ +uno::Any SAL_CALL Wall::queryInterface( const uno::Type& aType ) + throw (uno::RuntimeException) +{ + return ::cppu::OWeakObject::queryInterface( aType ); +} + +void SAL_CALL Wall::acquire() throw () +{ + ::cppu::OWeakObject::acquire(); +} + +void SAL_CALL Wall::release() throw () +{ + ::cppu::OWeakObject::release(); +} + +// ================================================================================ + +uno::Sequence< ::rtl::OUString > Wall::getSupportedServiceNames_Static() +{ + uno::Sequence< ::rtl::OUString > aServices( 2 ); + aServices[ 0 ] = C2U( "drafts.com.sun.star.chart2.Wall" ); + aServices[ 1 ] = C2U( "com.sun.star.beans.PropertySet" ); + return aServices; +} + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( Wall, lcl_aServiceName ); + +} // namespace chart diff --git a/chart2/source/model/main/Wall.hxx b/chart2/source/model/main/Wall.hxx new file mode 100644 index 000000000000..ac1f8dff897e --- /dev/null +++ b/chart2/source/model/main/Wall.hxx @@ -0,0 +1,131 @@ +/************************************************************************* + * + * $RCSfile: Wall.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_WALL_HXX +#define CHART_WALL_HXX + +// #ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +// #include <com/sun/star/uno/XComponentContext.hpp> +// #endif + +#ifndef CHART_MUTEXCONTAINER_HXX +#include "MutexContainer.hxx" +#endif + +#ifndef CHART_OPROPERTYSET_HXX +#include "OPropertySet.hxx" +#endif +#ifndef _CPPUHELPER_WEAK_HXX_ +#include <cppuhelper/weak.hxx> +#endif + +#include "ServiceMacros.hxx" + +#ifndef _COMPHELPER_UNO3_HXX_ +#include <comphelper/uno3.hxx> +#endif + +namespace chart +{ + +class Wall : + public helper::MutexContainer, + public ::property::OPropertySet, + public ::cppu::OWeakObject +{ +public: + Wall(); +// Wall( ::com::sun::star::uno::Reference< +// ::com::sun::star::uno::XComponentContext > const & xContext ); + virtual ~Wall(); + + /// XServiceInfo declarations + APPHELPER_XSERVICEINFO_DECL() + + /// merge XInterface implementations + DECLARE_XINTERFACE() + +protected: + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + +// virtual sal_Bool SAL_CALL convertFastPropertyValue +// ( ::com::sun::star::uno::Any & rConvertedValue, +// ::com::sun::star::uno::Any & rOldValue, +// sal_Int32 nHandle, +// const ::com::sun::star::uno::Any& rValue ) +// throw (::com::sun::star::lang::IllegalArgumentException); + +private: +}; + +} // namespace chart + +// CHART_WALL_HXX +#endif diff --git a/chart2/source/model/main/_serviceregistration_model.cxx b/chart2/source/model/main/_serviceregistration_model.cxx new file mode 100644 index 000000000000..853cd7edea18 --- /dev/null +++ b/chart2/source/model/main/_serviceregistration_model.cxx @@ -0,0 +1,265 @@ +/************************************************************************* + * + * $RCSfile: _serviceregistration_model.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CPPUHELPER_IMPLEMENATIONENTRY_HXX_ +#include <cppuhelper/implementationentry.hxx> +#endif +#ifndef _CHARTMODEL_HXX +#include "ChartModel.hxx" +#endif +#ifndef CHART_FILEDATAPROVIDER_HXX +#include "FileDataProvider.hxx" +#endif +#ifndef CHART_FILEDATASOURCE_HXX +#include "FileDataSource.hxx" +#endif + +#include "Diagram.hxx" +#include "Legend.hxx" +#include "Axis.hxx" +#include "Grid.hxx" +#include "Title.hxx" +#include "FormattedString.hxx" + +#include "DataSeriesTree.hxx" +#include "ChartTypeGroup.hxx" +#include "ContinuousScaleGroup.hxx" +#include "DiscreteScaleGroup.hxx" + +#include "ChartTypeManager.hxx" +// #include "BoundedCoordinateSystem.hxx" +#include "Scale.hxx" + +static struct ::cppu::ImplementationEntry g_entries_chart2_model[] = +{ + { + ::chart::ChartModel::create + , ::chart::ChartModel::getImplementationName_Static + , ::chart::ChartModel::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::FileDataProvider::create + , ::chart::FileDataProvider::getImplementationName_Static + , ::chart::FileDataProvider::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::FileDataSource::create + , ::chart::FileDataSource::getImplementationName_Static + , ::chart::FileDataSource::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::Diagram::create + , ::chart::Diagram::getImplementationName_Static + , ::chart::Diagram::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::Legend::create + , ::chart::Legend::getImplementationName_Static + , ::chart::Legend::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::Axis::create + , ::chart::Axis::getImplementationName_Static + , ::chart::Axis::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::Grid::create + , ::chart::Grid::getImplementationName_Static + , ::chart::Grid::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::Title::create + , ::chart::Title::getImplementationName_Static + , ::chart::Title::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + + ,{ + ::chart::FormattedString::create + , ::chart::FormattedString::getImplementationName_Static + , ::chart::FormattedString::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + + ,{ + ::chart::DataSeriesTree::create + , ::chart::DataSeriesTree::getImplementationName_Static + , ::chart::DataSeriesTree::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::ChartTypeGroup::create + , ::chart::ChartTypeGroup::getImplementationName_Static + , ::chart::ChartTypeGroup::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::ContinuousScaleGroup::create + , ::chart::ContinuousScaleGroup::getImplementationName_Static + , ::chart::ContinuousScaleGroup::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::DiscreteScaleGroup::create + , ::chart::DiscreteScaleGroup::getImplementationName_Static + , ::chart::DiscreteScaleGroup::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::ContinuousStackableScaleGroup::create + , ::chart::ContinuousStackableScaleGroup::getImplementationName_Static + , ::chart::ContinuousStackableScaleGroup::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::DiscreteStackableScaleGroup::create + , ::chart::DiscreteStackableScaleGroup::getImplementationName_Static + , ::chart::DiscreteStackableScaleGroup::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ + ::chart::ChartTypeManager::create + , ::chart::ChartTypeManager::getImplementationName_Static + , ::chart::ChartTypeManager::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } +// ,{ +// ::chart::BoundedCoordinateSystem::create +// , ::chart::BoundedCoordinateSystem::getImplementationName_Static +// , ::chart::BoundedCoordinateSystem::getSupportedServiceNames_Static +// , ::cppu::createSingleComponentFactory +// , 0 +// , 0 +// } + ,{ + ::chart::Scale::create + , ::chart::Scale::getImplementationName_Static + , ::chart::Scale::getSupportedServiceNames_Static + , ::cppu::createSingleComponentFactory + , 0 + , 0 + } + ,{ 0, 0, 0, 0, 0, 0 } +}; + +// component exports +extern "C" +{ +//================================================================================================== +void SAL_CALL component_getImplementationEnvironment( + const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} +//================================================================================================== +sal_Bool SAL_CALL component_writeInfo( + void * pServiceManager, void * pRegistryKey ) +{ + return ::cppu::component_writeInfoHelper( + pServiceManager, pRegistryKey, g_entries_chart2_model ); +} +//================================================================================================== +void * SAL_CALL component_getFactory( + const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) +{ + return ::cppu::component_getFactoryHelper( + pImplName, pServiceManager, pRegistryKey , g_entries_chart2_model ); +} +} +//========================================================================= diff --git a/chart2/source/model/main/makefile.mk b/chart2/source/model/main/makefile.mk new file mode 100644 index 000000000000..35b7c0eb3734 --- /dev/null +++ b/chart2/source/model/main/makefile.mk @@ -0,0 +1,116 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ= ..$/..$/.. +PRJNAME= chart2 +TARGET= chmodelmain + +PRJINC= $(PRJ)$/source + +ENABLE_EXCEPTIONS= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: settings.mk + +# --- export library ------------------------------------------------- + +#Specifies object files to bind into linked libraries. +SLOFILES= \ + $(SLO)$/Axis.obj \ + $(SLO)$/BoundedCoordinateSystem.obj \ + $(SLO)$/CachedDataSequence.obj \ + $(SLO)$/CartesianCoordinateSystem.obj \ + $(SLO)$/ChartModel.obj \ + $(SLO)$/DataInterpreter.obj \ + $(SLO)$/DataPoint.obj \ + $(SLO)$/DataPointProperties.obj \ + $(SLO)$/DataPointStyle.obj \ + $(SLO)$/DataSeries.obj \ + $(SLO)$/DataSeriesStyle.obj \ + $(SLO)$/Diagram.obj \ + $(SLO)$/DataSeriesProperties.obj \ + $(SLO)$/FileDataProvider.obj \ + $(SLO)$/FileDataSource.obj \ + $(SLO)$/FillProperties.obj \ + $(SLO)$/FormattedString.obj \ + $(SLO)$/Grid.obj \ + $(SLO)$/IdentityTransformation.obj \ + $(SLO)$/ImplChartModel.obj \ + $(SLO)$/Increment.obj \ + $(SLO)$/LayoutContainer.obj \ + $(SLO)$/Legend.obj \ + $(SLO)$/LineProperties.obj \ + $(SLO)$/PolarCoordinateSystem.obj \ + $(SLO)$/PolarTransformation.obj \ + $(SLO)$/Scale.obj \ + $(SLO)$/StyleFamilies.obj \ + $(SLO)$/StyleFamily.obj \ + $(SLO)$/Title.obj \ + $(SLO)$/UserDefinedProperties.obj \ + $(SLO)$/Wall.obj \ + $(SLO)$/CharacterProperties.obj \ + $(SLO)$/_serviceregistration_model.obj + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk diff --git a/chart2/source/model/makefile.mk b/chart2/source/model/makefile.mk new file mode 100644 index 000000000000..5350ef564829 --- /dev/null +++ b/chart2/source/model/makefile.mk @@ -0,0 +1,127 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:29 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ= ..$/.. +PRJNAME= chart2 +TARGET= chartmodel + +USE_DEFFILE= TRUE +ENABLE_EXCEPTIONS= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: $(PRJ)$/util$/makefile.pmk + +# --- export library ------------------------------------------------- + +#You can use several library macros of this form to build libraries that +#do not consist of all object files in a directory or to merge different libraries. +LIB1TARGET= $(SLB)$/_$(TARGET).lib + +LIB1FILES= \ + $(SLB)$/chmodelmain.lib \ + $(SLB)$/chmodeltree.lib \ + $(SLB)$/chmodeltemplate.lib \ + $(SLB)$/chmodeloldapi.lib + +#-------- + +#Indicates the filename of the shared library. +SHL1TARGET= $(TARGET)$(UPD)$(DLLPOSTFIX) + +#indicates dependencies: +# SHL1DEPN = \ +# $(SLB)$/charttools.lib + +#Specifies an import library to create. For Win32 only. +SHL1IMPLIB= i$(TARGET) + +#Specifies libraries from the same module to put into the shared library. +#was created above +SHL1LIBS= $(LIB1TARGET) + +#Links import libraries. + +SHL1STDLIBS= $(CHARTTOOLS) \ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(COMPHELPERLIB) \ + $(TOOLSLIB) \ + $(SALLIB) + +#--------exports + +#specifies the exported symbols for Windows only: +SHL1DEF= $(MISC)$/$(SHL1TARGET).def + +SHL1VERSIONMAP = model.map + +#--------definition file + +#name of the definition file: +DEF1NAME= $(SHL1TARGET) + +# --- Resources --------------------------------------------------------------- + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk diff --git a/chart2/source/model/model.map b/chart2/source/model/model.map new file mode 100644 index 000000000000..7698cb349177 --- /dev/null +++ b/chart2/source/model/model.map @@ -0,0 +1,9 @@ +CHART_1_0 { + global: + component_getImplementationEnvironment; + component_writeInfo; + component_getFactory; + component_getDescriptionFunc; + local: + *; +}; diff --git a/chart2/source/model/template/AreaChartType.cxx b/chart2/source/model/template/AreaChartType.cxx new file mode 100644 index 000000000000..b8f5b9c96328 --- /dev/null +++ b/chart2/source/model/template/AreaChartType.cxx @@ -0,0 +1,83 @@ +/************************************************************************* + * + * $RCSfile: AreaChartType.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "AreaChartType.hxx" + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +namespace chart +{ + +AreaChartType::AreaChartType( sal_Int32 nDim /* = 2 */ ) : + ChartType( nDim ) +{} + +AreaChartType::~AreaChartType() +{} + +// ____ XChartType ____ +::rtl::OUString SAL_CALL AreaChartType::getChartType() + throw (uno::RuntimeException) +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.AreaChart" )); +} + +} // namespace chart diff --git a/chart2/source/model/template/AreaChartType.hxx b/chart2/source/model/template/AreaChartType.hxx new file mode 100644 index 000000000000..d3e7cd40bd09 --- /dev/null +++ b/chart2/source/model/template/AreaChartType.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * $RCSfile: AreaChartType.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_AREACHARTTYPE_HXX +#define CHART_AREACHARTTYPE_HXX + +#include "ChartType.hxx" + +namespace chart +{ + +class AreaChartType : public ChartType +{ +public: + AreaChartType( sal_Int32 nDim = 2 ); + virtual ~AreaChartType(); + +protected: + // ____ XChartType ____ + virtual ::rtl::OUString SAL_CALL getChartType() + throw (::com::sun::star::uno::RuntimeException); +}; + +} // namespace chart + +// CHART_AREACHARTTYPE_HXX +#endif diff --git a/chart2/source/model/template/AreaChartTypeTemplate.cxx b/chart2/source/model/template/AreaChartTypeTemplate.cxx new file mode 100644 index 000000000000..d84b17d09731 --- /dev/null +++ b/chart2/source/model/template/AreaChartTypeTemplate.cxx @@ -0,0 +1,100 @@ +/************************************************************************* + * + * $RCSfile: AreaChartTypeTemplate.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "AreaChartTypeTemplate.hxx" +#include "AreaChartType.hxx" + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +namespace chart +{ + +AreaChartTypeTemplate::AreaChartTypeTemplate( + uno::Reference< + uno::XComponentContext > const & xContext, + chart2::StackMode eStackMode, + sal_Int32 nDim /* = 2 */ ) : + ChartTypeTemplate( xContext ), + m_eStackMode( eStackMode ), + m_nDim( nDim ) +{} + +AreaChartTypeTemplate::~AreaChartTypeTemplate() +{} + +sal_Int32 AreaChartTypeTemplate::getDimension() const +{ + return m_nDim; +} + +chart2::StackMode AreaChartTypeTemplate::getStackMode() const +{ + return m_eStackMode; +} + +// ____ XChartTypeTemplate ____ +uno::Reference< chart2::XChartType > SAL_CALL AreaChartTypeTemplate::getChartTypeForAdditionalSeries() + throw (uno::RuntimeException) +{ + return new AreaChartType( m_nDim ); +} + +} // namespace chart diff --git a/chart2/source/model/template/AreaChartTypeTemplate.hxx b/chart2/source/model/template/AreaChartTypeTemplate.hxx new file mode 100644 index 000000000000..4c0dbdc1f09c --- /dev/null +++ b/chart2/source/model/template/AreaChartTypeTemplate.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * $RCSfile: AreaChartTypeTemplate.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_AREACHARTTYPETEMPLATE_HXX +#define CHART_AREACHARTTYPETEMPLATE_HXX + +#include "ChartTypeTemplate.hxx" + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_STACKMODE_HPP_ +#include <drafts/com/sun/star/chart2/StackMode.hpp> +#endif + +namespace chart +{ + +class AreaChartTypeTemplate : public ChartTypeTemplate +{ +public: + explicit AreaChartTypeTemplate( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext, + ::drafts::com::sun::star::chart2::StackMode eStackMode, + sal_Int32 nDim = 2 ); + virtual ~AreaChartTypeTemplate(); + +protected: + // ____ ChartTypeTemplate ____ + virtual sal_Int32 getDimension() const; + virtual ::drafts::com::sun::star::chart2::StackMode getStackMode() const; + + // ____ XChartTypeTemplate ____ + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartType > SAL_CALL getChartTypeForAdditionalSeries() + throw (::com::sun::star::uno::RuntimeException); + +private: + ::drafts::com::sun::star::chart2::StackMode + m_eStackMode; + sal_Int32 m_nDim; +}; + +} // namespace chart + +// CHART_AREACHARTTYPETEMPLATE_HXX +#endif diff --git a/chart2/source/model/template/BarChartType.cxx b/chart2/source/model/template/BarChartType.cxx new file mode 100644 index 000000000000..cd4b4f5ee019 --- /dev/null +++ b/chart2/source/model/template/BarChartType.cxx @@ -0,0 +1,83 @@ +/************************************************************************* + * + * $RCSfile: BarChartType.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "BarChartType.hxx" + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +namespace chart +{ + +BarChartType::BarChartType( sal_Int32 nDim /* = 2 */ ) : + ChartType( nDim ) +{} + +BarChartType::~BarChartType() +{} + +// ____ XChartType ____ +::rtl::OUString SAL_CALL BarChartType::getChartType() + throw (uno::RuntimeException) +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.BarChart" )); +} + +} // namespace chart diff --git a/chart2/source/model/template/BarChartType.hxx b/chart2/source/model/template/BarChartType.hxx new file mode 100644 index 000000000000..42819f712ca2 --- /dev/null +++ b/chart2/source/model/template/BarChartType.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * $RCSfile: BarChartType.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_BARCHARTTYPE_HXX +#define CHART_BARCHARTTYPE_HXX + +#include "ChartType.hxx" + +namespace chart +{ + +class BarChartType : public ChartType +{ +public: + BarChartType( sal_Int32 nDim = 2 ); + virtual ~BarChartType(); + +protected: + // ____ XChartType ____ + virtual ::rtl::OUString SAL_CALL getChartType() + throw (::com::sun::star::uno::RuntimeException); +}; + +} // namespace chart + +// CHART_BARCHARTTYPE_HXX +#endif diff --git a/chart2/source/model/template/BarChartTypeTemplate.cxx b/chart2/source/model/template/BarChartTypeTemplate.cxx new file mode 100644 index 000000000000..91f988602939 --- /dev/null +++ b/chart2/source/model/template/BarChartTypeTemplate.cxx @@ -0,0 +1,104 @@ +/************************************************************************* + * + * $RCSfile: BarChartTypeTemplate.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "BarChartTypeTemplate.hxx" +#include "BarChartType.hxx" + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +namespace chart +{ + +BarChartTypeTemplate::BarChartTypeTemplate( + uno::Reference< + uno::XComponentContext > const & xContext, + chart2::StackMode eStackMode, + BarDirection eDirection, + sal_Int32 nDim /* = 2 */, + ThreeDMode eThreeDMode /* = THREE_D_FLAT */ ) : + ChartTypeTemplate( xContext ), + m_eStackMode( eStackMode ), + m_eBarDirection( eDirection ), + m_nDim( nDim ), + m_eThreeDMode( eThreeDMode ) +{} + +BarChartTypeTemplate::~BarChartTypeTemplate() +{} + +sal_Int32 BarChartTypeTemplate::getDimension() const +{ + return m_nDim; +} + +chart2::StackMode BarChartTypeTemplate::getStackMode() const +{ + return m_eStackMode; +} + +// ____ XChartTypeTemplate ____ +uno::Reference< chart2::XChartType > SAL_CALL BarChartTypeTemplate::getChartTypeForAdditionalSeries() + throw (uno::RuntimeException) +{ + return new BarChartType( m_nDim ); +} + +} // namespace chart diff --git a/chart2/source/model/template/BarChartTypeTemplate.hxx b/chart2/source/model/template/BarChartTypeTemplate.hxx new file mode 100644 index 000000000000..6ca1e720e447 --- /dev/null +++ b/chart2/source/model/template/BarChartTypeTemplate.hxx @@ -0,0 +1,118 @@ +/************************************************************************* + * + * $RCSfile: BarChartTypeTemplate.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_BARCHARTTYPETEMPLATE_HXX +#define CHART_BARCHARTTYPETEMPLATE_HXX + +#include "ChartTypeTemplate.hxx" + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_STACKMODE_HPP_ +#include <drafts/com/sun/star/chart2/StackMode.hpp> +#endif + +namespace chart +{ + +class BarChartTypeTemplate : public ChartTypeTemplate +{ +public: + enum BarDirection + { + HORIZONTAL, + VERTICAL + }; + + enum ThreeDMode + { + THREE_D_FLAT, + THREE_D_DEEP + }; + + explicit BarChartTypeTemplate( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext, + ::drafts::com::sun::star::chart2::StackMode eStackMode, + BarDirection eDirection, + sal_Int32 nDim = 2, + ThreeDMode eThreeDMode = THREE_D_FLAT ); + virtual ~BarChartTypeTemplate(); + +protected: + // ____ ChartTypeTemplate ____ + virtual sal_Int32 getDimension() const; + virtual ::drafts::com::sun::star::chart2::StackMode getStackMode() const; + + // ____ XChartTypeTemplate ____ + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartType > SAL_CALL getChartTypeForAdditionalSeries() + throw (::com::sun::star::uno::RuntimeException); + +private: + ::drafts::com::sun::star::chart2::StackMode + m_eStackMode; + BarDirection m_eBarDirection; + sal_Int32 m_nDim; + ThreeDMode m_eThreeDMode; +}; + +} // namespace chart + +// CHART_BARCHARTTYPETEMPLATE_HXX +#endif diff --git a/chart2/source/model/template/ChartType.cxx b/chart2/source/model/template/ChartType.cxx new file mode 100644 index 000000000000..6462db1a8379 --- /dev/null +++ b/chart2/source/model/template/ChartType.cxx @@ -0,0 +1,221 @@ +/************************************************************************* + * + * $RCSfile: ChartType.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ChartType.hxx" +#include "PropertyHelper.hxx" +#include "algohelper.hxx" +#include "macros.hxx" + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +using ::rtl::OUString; +using ::com::sun::star::beans::Property; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::osl::MutexGuard; + +namespace +{ + +enum +{ + PROP_CHARTTYPE_DIMENSION +}; + +void lcl_AddPropertiesToVector( + ::std::vector< Property > & rOutProperties ) +{ + rOutProperties.push_back( + Property( C2U( "Dimension" ), + PROP_CHARTTYPE_DIMENSION, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); +} + +void lcl_AddDefaultsToMap( + ::chart::helper::tPropertyValueMap & rOutMap ) +{ + // must match default in CTOR! + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_CHARTTYPE_DIMENSION )); + rOutMap[ PROP_CHARTTYPE_DIMENSION ] = + uno::makeAny( sal_Int32( 2 ) ); +} + +const Sequence< Property > & lcl_GetPropertySequence() +{ + static Sequence< Property > aPropSeq; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + lcl_AddPropertiesToVector( aProperties ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::helper::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::helper::VectorToSequence( aProperties ); + } + + return aPropSeq; +} + +} // anonymous namespace + +namespace chart +{ + +ChartType::ChartType( sal_Int32 nDim /* = 2 */ ) : + ::property::OPropertySet( m_aMutex ) +{ + if( nDim != 2 ) + setFastPropertyValue_NoBroadcast( PROP_CHARTTYPE_DIMENSION, uno::makeAny( nDim )); +} + +ChartType::~ChartType() +{} + +Sequence< OUString > ChartType::getSupportedServiceNames_Static() +{ + Sequence< OUString > aServices( 2 ); + + aServices[ 0 ] = C2U( "drafts.com.sun.star.chart2.ChartType" ); + aServices[ 1 ] = C2U( "com.sun.star.beans.PropertySet" ); + return aServices; +} + +// ____ OPropertySet ____ +uno::Any ChartType::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static helper::tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + // initialize defaults + lcl_AddDefaultsToMap( aStaticDefaults ); + } + + helper::tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + return uno::Any(); + + return (*aFound).second; + // \-- +} + +// ____ OPropertySet ____ +::cppu::IPropertyArrayHelper & SAL_CALL ChartType::getInfoHelper() +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + + +// ____ XPropertySet ____ +uno::Reference< beans::XPropertySetInfo > SAL_CALL + ChartType::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static uno::Reference< beans::XPropertySetInfo > xInfo; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +// ================================================================================ + +using impl::ChartType_Base; + +IMPLEMENT_FORWARD_XINTERFACE2( ChartType, ChartType_Base, ::property::OPropertySet ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( ChartType, ChartType_Base, ::property::OPropertySet ) + +// do this in derived classes! + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( ChartType, + C2U( "com.sun.star.comp.chart.ChartType" )); + +} // namespace chart diff --git a/chart2/source/model/template/ChartType.hxx b/chart2/source/model/template/ChartType.hxx new file mode 100644 index 000000000000..060991366b50 --- /dev/null +++ b/chart2/source/model/template/ChartType.hxx @@ -0,0 +1,144 @@ +/************************************************************************* + * + * $RCSfile: ChartType.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_CHARTTYPE_HXX +#define CHART_CHARTTYPE_HXX + +#ifndef CHART_MUTEXCONTAINER_HXX +#include "MutexContainer.hxx" +#endif +#ifndef CHART_OPROPERTYSET_HXX +#include "OPropertySet.hxx" +#endif + +#ifndef _CPPUHELPER_IMPLBASE1_HXX_ +#include <cppuhelper/implbase1.hxx> +#endif +#ifndef _COMPHELPER_UNO3_HXX_ +#include <comphelper/uno3.hxx> +#endif +#include "ServiceMacros.hxx" + +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTTYPE_HPP_ +#include <drafts/com/sun/star/chart2/XChartType.hpp> +#endif + +namespace chart +{ + +namespace impl +{ +typedef ::cppu::WeakImplHelper1< + ::drafts::com::sun::star::chart2::XChartType > + ChartType_Base; +} + +class ChartType : + public helper::MutexContainer, + public impl::ChartType_Base, + public ::property::OPropertySet +{ +public: + ChartType( sal_Int32 nDim = 2 ); + virtual ~ChartType(); + +protected: + // ____ XChartType ____ + // still abstract ! implement ! + virtual ::rtl::OUString SAL_CALL getChartType() + throw (::com::sun::star::uno::RuntimeException) = 0; + + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + +// virtual sal_Bool SAL_CALL convertFastPropertyValue +// ( ::com::sun::star::uno::Any & rConvertedValue, +// ::com::sun::star::uno::Any & rOldValue, +// sal_Int32 nHandle, +// const ::com::sun::star::uno::Any& rValue ) +// throw (::com::sun::star::lang::IllegalArgumentException); + + // declare this in derived classes ! + APPHELPER_XSERVICEINFO_DECL() + + /// merge XInterface implementations + DECLARE_XINTERFACE() + /// merge XTypeProvider implementations + DECLARE_XTYPEPROVIDER() + +private: +}; + +} // namespace chart + +// CHART_CHARTTYPE_HXX +#endif diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx new file mode 100644 index 000000000000..4457ba879921 --- /dev/null +++ b/chart2/source/model/template/ChartTypeManager.cxx @@ -0,0 +1,734 @@ +/************************************************************************* + * + * $RCSfile: ChartTypeManager.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:31 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ChartTypeManager.hxx" +#include "PropertyHelper.hxx" +#include "algohelper.hxx" +#include "macros.hxx" +#include "ContextHelper.hxx" + +#include "Scaling.hxx" +#include "CartesianCoordinateSystem.hxx" +#include "DoubleStackedBarChartTypeTemplate.hxx" + +#include "LineChartTypeTemplate.hxx" +#include "BarChartTypeTemplate.hxx" +#include "ColumnLineChartTypeTemplate.hxx" +#include "AreaChartTypeTemplate.hxx" +#include "PieChartTypeTemplate.hxx" + +#ifndef _CPPUHELPER_COMPONENT_CONTEXT_HXX_ +#include <cppuhelper/component_context.hxx> +#endif + +#ifndef _COM_SUN_STAR_CONTAINER_XCONTENTENUMERATIONACCESS_HPP_ +#include <com/sun/star/container/XContentEnumerationAccess.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICENAME_HPP_ +#include <com/sun/star/lang/XServiceName.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif +#ifndef _COM_SUN_STAR_CHART_CHARTSOLIDTYPE_HPP_ +#include <com/sun/star/chart/ChartSolidType.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTTYPEGROUP_HPP_ +#include <drafts/com/sun/star/chart2/XChartTypeGroup.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XSTACKABLESCALEGROUP_HPP_ +#include <drafts/com/sun/star/chart2/XStackableScaleGroup.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_STACKMODE_HPP_ +#include <drafts/com/sun/star/chart2/StackMode.hpp> +#endif + +#include <algorithm> +#include <iterator> +#include <functional> + +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans::PropertyAttribute; +using namespace ::drafts::com::sun::star; + +using ::rtl::OUString; +using ::com::sun::star::beans::Property; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::osl::MutexGuard; + +// ====================================================================== + +namespace +{ +enum +{ + PROP_TEMPLATE_MANAGER_CHART_TEMPLATE_NAME, + PROP_TEMPLATE_MANAGER_SOLID_TYPE, + PROP_TEMPLATE_MANAGER_NUMBER_OF_LINES, + PROP_TEMPLATE_MANAGER_SPLINE_ORDER, + PROP_TEMPLATE_MANAGER_SPLINE_RESOLUTION +}; + +void lcl_AddPropertiesToVector( + ::std::vector< Property > & rOutProperties ) +{ + // preliminary + rOutProperties.push_back( + Property( C2U( "ChartStyleTemplateServiceName" ), + PROP_TEMPLATE_MANAGER_CHART_TEMPLATE_NAME, + ::getCppuType( reinterpret_cast< const OUString * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + // properties for the chart type dialog + rOutProperties.push_back( + Property( C2U( "SolidType" ), + PROP_TEMPLATE_MANAGER_SOLID_TYPE, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "NumberOfLines" ), + PROP_TEMPLATE_MANAGER_NUMBER_OF_LINES, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "SplineOrder" ), + PROP_TEMPLATE_MANAGER_SPLINE_ORDER, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "SplineResolution" ), + PROP_TEMPLATE_MANAGER_SPLINE_RESOLUTION, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); +} + +void lcl_AddDefaultsToMap( + ::chart::helper::tPropertyValueMap & rOutMap ) +{ + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_TEMPLATE_MANAGER_CHART_TEMPLATE_NAME )); + rOutMap[ PROP_TEMPLATE_MANAGER_CHART_TEMPLATE_NAME ] = + uno::makeAny( + ::rtl::OUString( C2U( "com.sun.star.chart2.template.Column" ))); + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_TEMPLATE_MANAGER_SOLID_TYPE )); + rOutMap[ PROP_TEMPLATE_MANAGER_SOLID_TYPE ] = + uno::makeAny( ::com::sun::star::chart::ChartSolidType::RECTANGULAR_SOLID ); + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_TEMPLATE_MANAGER_NUMBER_OF_LINES )); + rOutMap[ PROP_TEMPLATE_MANAGER_NUMBER_OF_LINES ] = + uno::makeAny( sal_Int32( 0 )); + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_TEMPLATE_MANAGER_SPLINE_ORDER )); + rOutMap[ PROP_TEMPLATE_MANAGER_SPLINE_ORDER ] = + uno::makeAny( sal_Int32( 3 )); + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_TEMPLATE_MANAGER_SPLINE_RESOLUTION )); + rOutMap[ PROP_TEMPLATE_MANAGER_SPLINE_RESOLUTION ] = + uno::makeAny( sal_Int32( 20 )); +} + +const Sequence< Property > & lcl_GetPropertySequence() +{ + static Sequence< Property > aPropSeq; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + lcl_AddPropertiesToVector( aProperties ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::helper::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::helper::VectorToSequence( aProperties ); + } + + return aPropSeq; +} + +enum TemplateId +{ + TEMPLATE_LINE, + TEMPLATE_STACKEDLINE, + TEMPLATE_PERCENTSTACKEDLINE, + TEMPLATE_LINESYMBOL, + TEMPLATE_STACKEDLINESYMBOL, + TEMPLATE_PERCENTSTACKEDLINESYMBOL, + TEMPLATE_CUBICSPLINE, + TEMPLATE_CUBICSPLINESYMBOL, + TEMPLATE_BSPLINE, + TEMPLATE_BSPLINESYMBOL, + TEMPLATE_THREEDLINE, + TEMPLATE_COLUMN, + TEMPLATE_STACKEDCOLUMN, + TEMPLATE_PERCENTSTACKEDCOLUMN, + TEMPLATE_BAR, + TEMPLATE_STACKEDBAR, + TEMPLATE_PERCENTSTACKEDBAR, + TEMPLATE_THREEDCOLUMNDEEP, + TEMPLATE_THREEDCOLUMNFLAT, + TEMPLATE_STACKEDTHREEDCOLUMNFLAT, + TEMPLATE_PERCENTSTACKEDTHREEDCOLUMNFLAT, + TEMPLATE_THREEDBARDEEP, + TEMPLATE_THREEDBARFLAT, + TEMPLATE_STACKEDTHREEDBARFLAT, + TEMPLATE_PERCENTSTACKEDTHREEDBARFLAT, + TEMPLATE_COLUMNWITHONELINE, + TEMPLATE_STACKEDCOLUMNWITHONELINE, + TEMPLATE_AREA, + TEMPLATE_STACKEDAREA, + TEMPLATE_PERCENTSTACKEDAREA, + TEMPLATE_THREEDAREA, + TEMPLATE_STACKEDTHREEDAREA, + TEMPLATE_PERCENTSTACKEDTHREEDAREA, + TEMPLATE_PIE, + TEMPLATE_PIEONEEXPLODED, + TEMPLATE_PIEALLEXPLODED, + TEMPLATE_RING, + TEMPLATE_THREEDPIE, + TEMPLATE_SCATTERLINESYMBOL, + TEMPLATE_CUBICSPLINESCATTER, + TEMPLATE_CUBICSPLINESCATTERSYMBOL, + TEMPLATE_BSPLINESCATTER, + TEMPLATE_BSPLINESCATTERSYMBOL, + TEMPLATE_SCATTERLINE, + TEMPLATE_SCATTERSYMBOL, + TEMPLATE_NET, + TEMPLATE_NETSYMBOL, + TEMPLATE_STACKEDNET, + TEMPLATE_STACKEDNETSYMBOL, + TEMPLATE_PERCENTSTACKEDNET, + TEMPLATE_PERCENTSTACKEDNETSYMBOL, + TEMPLATE_STOCKLOWHIGHCLOSE, + TEMPLATE_STOCKOPENLOWHIGHCLOSE, + TEMPLATE_STOCKVOLUMELOWHIGHCLOSE, + TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE, + TEMPLATE_SURFACE, + TEMPLATE_THREEDSCATTER, + TEMPLATE_THREEDSCATTERSYMBOL, + TEMPLATE_ADDIN, + TEMPLATE_NOT_FOUND = 0xffff +}; + +typedef ::std::map< OUString, TemplateId > tTemplateMapType; + +const tTemplateMapType & lcl_DefaultChartTypeMap() +{ + static const tTemplateMapType aMap = tTemplateMapType( + ::comphelper::MakeMap< tTemplateMapType::key_type, tTemplateMapType::data_type > + ( C2U( "com.sun.star.chart2.template.Line" ), TEMPLATE_LINE ) + ( C2U( "com.sun.star.chart2.template.StackedLine" ), TEMPLATE_STACKEDLINE ) + ( C2U( "com.sun.star.chart2.template.PercentStackedLine" ), TEMPLATE_PERCENTSTACKEDLINE ) + ( C2U( "com.sun.star.chart2.template.LineSymbol" ), TEMPLATE_LINESYMBOL ) + ( C2U( "com.sun.star.chart2.template.StackedLineSymbol" ), TEMPLATE_STACKEDLINESYMBOL ) + ( C2U( "com.sun.star.chart2.template.PercentStackedLineSymbol" ), TEMPLATE_PERCENTSTACKEDLINESYMBOL ) + ( C2U( "com.sun.star.chart2.template.CubicSpline" ), TEMPLATE_CUBICSPLINE ) + ( C2U( "com.sun.star.chart2.template.CubicSplineSymbol" ), TEMPLATE_CUBICSPLINESYMBOL ) + ( C2U( "com.sun.star.chart2.template.BSpline" ), TEMPLATE_BSPLINE ) + ( C2U( "com.sun.star.chart2.template.BSplineSymbol" ), TEMPLATE_BSPLINESYMBOL ) + ( C2U( "com.sun.star.chart2.template.ThreeDLine" ), TEMPLATE_THREEDLINE ) + ( C2U( "com.sun.star.chart2.template.Column" ), TEMPLATE_COLUMN ) + ( C2U( "com.sun.star.chart2.template.StackedColumn" ), TEMPLATE_STACKEDCOLUMN ) + ( C2U( "com.sun.star.chart2.template.PercentStackedColumn" ), TEMPLATE_PERCENTSTACKEDCOLUMN ) + ( C2U( "com.sun.star.chart2.template.Bar" ), TEMPLATE_BAR ) + ( C2U( "com.sun.star.chart2.template.StackedBar" ), TEMPLATE_STACKEDBAR ) + ( C2U( "com.sun.star.chart2.template.PercentStackedBar" ), TEMPLATE_PERCENTSTACKEDBAR ) + ( C2U( "com.sun.star.chart2.template.ThreeDColumnDeep" ), TEMPLATE_THREEDCOLUMNDEEP ) + ( C2U( "com.sun.star.chart2.template.ThreeDColumnFlat" ), TEMPLATE_THREEDCOLUMNFLAT ) + ( C2U( "com.sun.star.chart2.template.StackedThreeDColumnFlat" ), TEMPLATE_STACKEDTHREEDCOLUMNFLAT ) + ( C2U( "com.sun.star.chart2.template.PercentStackedThreeDColumnFlat" ), TEMPLATE_PERCENTSTACKEDTHREEDCOLUMNFLAT ) + ( C2U( "com.sun.star.chart2.template.ThreeDBarDeep" ), TEMPLATE_THREEDBARDEEP ) + ( C2U( "com.sun.star.chart2.template.ThreeDBarFlat" ), TEMPLATE_THREEDBARFLAT ) + ( C2U( "com.sun.star.chart2.template.StackedThreeDBarFlat" ), TEMPLATE_STACKEDTHREEDBARFLAT ) + ( C2U( "com.sun.star.chart2.template.PercentStackedThreeDBarFlat" ), TEMPLATE_PERCENTSTACKEDTHREEDBARFLAT ) + ( C2U( "com.sun.star.chart2.template.ColumnWithOneLine" ), TEMPLATE_COLUMNWITHONELINE ) + ( C2U( "com.sun.star.chart2.template.StackedColumnWithOneLine" ), TEMPLATE_STACKEDCOLUMNWITHONELINE ) + ( C2U( "com.sun.star.chart2.template.Area" ), TEMPLATE_AREA ) + ( C2U( "com.sun.star.chart2.template.StackedArea" ), TEMPLATE_STACKEDAREA ) + ( C2U( "com.sun.star.chart2.template.PercentStackedArea" ), TEMPLATE_PERCENTSTACKEDAREA ) + ( C2U( "com.sun.star.chart2.template.ThreeDArea" ), TEMPLATE_THREEDAREA ) + ( C2U( "com.sun.star.chart2.template.StackedThreeDArea" ), TEMPLATE_STACKEDTHREEDAREA ) + ( C2U( "com.sun.star.chart2.template.PercentStackedThreeDArea" ), TEMPLATE_PERCENTSTACKEDTHREEDAREA ) + ( C2U( "com.sun.star.chart2.template.Pie" ), TEMPLATE_PIE ) + ( C2U( "com.sun.star.chart2.template.PieOneExploded" ), TEMPLATE_PIEONEEXPLODED ) + ( C2U( "com.sun.star.chart2.template.PieAllExploded" ), TEMPLATE_PIEALLEXPLODED ) + ( C2U( "com.sun.star.chart2.template.Ring" ), TEMPLATE_RING ) + ( C2U( "com.sun.star.chart2.template.ThreeDPie" ), TEMPLATE_THREEDPIE ) + ( C2U( "com.sun.star.chart2.template.ScatterLineSymbol" ), TEMPLATE_SCATTERLINESYMBOL ) + ( C2U( "com.sun.star.chart2.template.CubicSplineScatter" ), TEMPLATE_CUBICSPLINESCATTER ) + ( C2U( "com.sun.star.chart2.template.CubicSplineScatterSymbol" ), TEMPLATE_CUBICSPLINESCATTERSYMBOL ) + ( C2U( "com.sun.star.chart2.template.BSplineScatter" ), TEMPLATE_BSPLINESCATTER ) + ( C2U( "com.sun.star.chart2.template.BSplineScatterSymbol" ), TEMPLATE_BSPLINESCATTERSYMBOL ) + ( C2U( "com.sun.star.chart2.template.ScatterLine" ), TEMPLATE_SCATTERLINE ) + ( C2U( "com.sun.star.chart2.template.ScatterSymbol" ), TEMPLATE_SCATTERSYMBOL ) + ( C2U( "com.sun.star.chart2.template.Net" ), TEMPLATE_NET ) + ( C2U( "com.sun.star.chart2.template.NetSymbol" ), TEMPLATE_NETSYMBOL ) + ( C2U( "com.sun.star.chart2.template.StackedNet" ), TEMPLATE_STACKEDNET ) + ( C2U( "com.sun.star.chart2.template.StackedNetSymbol" ), TEMPLATE_STACKEDNETSYMBOL ) + ( C2U( "com.sun.star.chart2.template.PercentStackedNet" ), TEMPLATE_PERCENTSTACKEDNET ) + ( C2U( "com.sun.star.chart2.template.PercentStackedNetSymbol" ), TEMPLATE_PERCENTSTACKEDNETSYMBOL ) + ( C2U( "com.sun.star.chart2.template.StockLowHighClose" ), TEMPLATE_STOCKLOWHIGHCLOSE ) + ( C2U( "com.sun.star.chart2.template.StockOpenLowHighClose" ), TEMPLATE_STOCKOPENLOWHIGHCLOSE ) + ( C2U( "com.sun.star.chart2.template.StockVolumeLowHighClose" ), TEMPLATE_STOCKVOLUMELOWHIGHCLOSE ) + ( C2U( "com.sun.star.chart2.template.StockVolumeOpenLowHighClose" ), TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE ) + ( C2U( "com.sun.star.chart2.template.Surface" ), TEMPLATE_SURFACE ) + ( C2U( "com.sun.star.chart2.template.ThreeDScatter" ), TEMPLATE_THREEDSCATTER ) + ( C2U( "com.sun.star.chart2.template.ThreeDScatterSymbol" ), TEMPLATE_THREEDSCATTERSYMBOL ) + ( C2U( "com.sun.star.chart2.template.Addin" ), TEMPLATE_ADDIN ) + ); + + return aMap; +} + +TemplateId lcl_GetTemplateIdForService( const OUString & rServiceName ) +{ + TemplateId eResult = TEMPLATE_NOT_FOUND; + const tTemplateMapType & rMap = lcl_DefaultChartTypeMap(); + tTemplateMapType::const_iterator aIt( rMap.find( rServiceName )); + + if( aIt != rMap.end()) + eResult = (*aIt).second; + + return eResult; +} + +} // anonymous namespace + +namespace chart +{ + +ChartTypeManager::ChartTypeManager( + uno::Reference< + uno::XComponentContext > const & xContext ) : + ::property::OPropertySet( m_aMutex ), + m_xContext( xContext ) +{} + +ChartTypeManager::~ChartTypeManager() +{} + +// ____ XMultiServiceFactory ____ +uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance( + const OUString& aServiceSpecifier ) + throw (uno::Exception, + uno::RuntimeException) +{ + uno::Reference< uno::XInterface > xResult; + TemplateId nId = lcl_GetTemplateIdForService( aServiceSpecifier ); + + if( nId == TEMPLATE_NOT_FOUND ) + { + xResult = m_xContext->getServiceManager()->createInstanceWithContext( + aServiceSpecifier, m_xContext ); + } + else + { + uno::Reference< chart2::XChartTypeTemplate > xTemplate; + switch( nId ) + { + // Line + case TEMPLATE_LINE: + xTemplate.set( new LineChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, LineChartTypeTemplate::NO_SPLINE, false )); + break; + case TEMPLATE_STACKEDLINE: + xTemplate.set( new LineChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED, LineChartTypeTemplate::NO_SPLINE, false )); + break; + case TEMPLATE_PERCENTSTACKEDLINE: + xTemplate.set( new LineChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED_PERCENT, LineChartTypeTemplate::NO_SPLINE, false )); + break; + case TEMPLATE_LINESYMBOL: + xTemplate.set( new LineChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, LineChartTypeTemplate::NO_SPLINE, true )); + break; + case TEMPLATE_STACKEDLINESYMBOL: + xTemplate.set( new LineChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED, LineChartTypeTemplate::NO_SPLINE, true )); + break; + case TEMPLATE_PERCENTSTACKEDLINESYMBOL: + xTemplate.set( new LineChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED_PERCENT, LineChartTypeTemplate::NO_SPLINE, true )); + break; + case TEMPLATE_CUBICSPLINE: + xTemplate.set( new LineChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, LineChartTypeTemplate::CUBIC_SPLINE, false )); + break; + case TEMPLATE_CUBICSPLINESYMBOL: + xTemplate.set( new LineChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, LineChartTypeTemplate::CUBIC_SPLINE, true )); + break; + case TEMPLATE_BSPLINE: + xTemplate.set( new LineChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, LineChartTypeTemplate::B_SPLINE, false )); + break; + case TEMPLATE_BSPLINESYMBOL: + xTemplate.set( new LineChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, LineChartTypeTemplate::B_SPLINE, true )); + break; + case TEMPLATE_THREEDLINE: + xTemplate.set( new LineChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, LineChartTypeTemplate::NO_SPLINE, false, 3 )); + break; + + // Bar/Column + case TEMPLATE_COLUMN: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, BarChartTypeTemplate::VERTICAL )); + break; + case TEMPLATE_STACKEDCOLUMN: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED, BarChartTypeTemplate::VERTICAL )); + break; + case TEMPLATE_PERCENTSTACKEDCOLUMN: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED_PERCENT, BarChartTypeTemplate::VERTICAL )); + break; + case TEMPLATE_BAR: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, BarChartTypeTemplate::HORIZONTAL )); + break; + case TEMPLATE_STACKEDBAR: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED, BarChartTypeTemplate::HORIZONTAL )); + break; + case TEMPLATE_PERCENTSTACKEDBAR: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED_PERCENT, BarChartTypeTemplate::HORIZONTAL )); + break; + case TEMPLATE_THREEDCOLUMNDEEP: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, BarChartTypeTemplate::VERTICAL, + 3, BarChartTypeTemplate::THREE_D_DEEP )); + break; + case TEMPLATE_THREEDCOLUMNFLAT: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, BarChartTypeTemplate::VERTICAL, + 3, BarChartTypeTemplate::THREE_D_FLAT )); + break; + case TEMPLATE_STACKEDTHREEDCOLUMNFLAT: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED, BarChartTypeTemplate::VERTICAL, + 3, BarChartTypeTemplate::THREE_D_FLAT )); + case TEMPLATE_PERCENTSTACKEDTHREEDCOLUMNFLAT: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED_PERCENT, BarChartTypeTemplate::VERTICAL, + 3, BarChartTypeTemplate::THREE_D_FLAT )); + case TEMPLATE_THREEDBARDEEP: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, BarChartTypeTemplate::HORIZONTAL, + 3, BarChartTypeTemplate::THREE_D_DEEP )); + break; + case TEMPLATE_THREEDBARFLAT: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, BarChartTypeTemplate::HORIZONTAL, + 3, BarChartTypeTemplate::THREE_D_FLAT )); + break; + case TEMPLATE_STACKEDTHREEDBARFLAT: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED, BarChartTypeTemplate::HORIZONTAL, + 3, BarChartTypeTemplate::THREE_D_FLAT )); + break; + case TEMPLATE_PERCENTSTACKEDTHREEDBARFLAT: + xTemplate.set( new BarChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED_PERCENT, BarChartTypeTemplate::HORIZONTAL, + 3, BarChartTypeTemplate::THREE_D_FLAT )); + break; + + // Combi-Chart Line/Column + case TEMPLATE_COLUMNWITHONELINE: + case TEMPLATE_STACKEDCOLUMNWITHONELINE: + { + chart2::StackMode eMode = ( nId == TEMPLATE_COLUMNWITHONELINE ) + ? chart2::StackMode_NONE + : chart2::StackMode_STACKED; + sal_Int32 nNumOfLines = 1; + getFastPropertyValue( PROP_TEMPLATE_MANAGER_NUMBER_OF_LINES ) >>= nNumOfLines; + + xTemplate.set( new ColumnLineChartTypeTemplate( m_xContext, eMode, nNumOfLines )); + } + break; + + // Area + case TEMPLATE_AREA: + xTemplate.set( new AreaChartTypeTemplate( m_xContext, chart2::StackMode_NONE )); + break; + case TEMPLATE_STACKEDAREA: + xTemplate.set( new AreaChartTypeTemplate( m_xContext, chart2::StackMode_STACKED )); + break; + case TEMPLATE_PERCENTSTACKEDAREA: + xTemplate.set( new AreaChartTypeTemplate( m_xContext, chart2::StackMode_STACKED_PERCENT )); + break; + case TEMPLATE_THREEDAREA: + xTemplate.set( new AreaChartTypeTemplate( m_xContext, chart2::StackMode_NONE, 3 )); + break; + case TEMPLATE_STACKEDTHREEDAREA: + xTemplate.set( new AreaChartTypeTemplate( m_xContext, chart2::StackMode_STACKED, 3 )); + break; + case TEMPLATE_PERCENTSTACKEDTHREEDAREA: + xTemplate.set( new AreaChartTypeTemplate( m_xContext, chart2::StackMode_STACKED_PERCENT, 3 )); + break; + + case TEMPLATE_PIE: + xTemplate.set( new PieChartTypeTemplate( m_xContext, + PieChartTypeTemplate::NO_OFFSET, false )); + break; + case TEMPLATE_PIEONEEXPLODED: + xTemplate.set( new PieChartTypeTemplate( m_xContext, + PieChartTypeTemplate::FIRST_EXPLODED, false )); + break; + case TEMPLATE_PIEALLEXPLODED: + xTemplate.set( new PieChartTypeTemplate( m_xContext, + PieChartTypeTemplate::ALL_EXPLODED, false )); + break; + case TEMPLATE_RING: + xTemplate.set( new PieChartTypeTemplate( m_xContext, + PieChartTypeTemplate::NO_OFFSET, true )); + break; + case TEMPLATE_THREEDPIE: + xTemplate.set( new PieChartTypeTemplate( m_xContext, + PieChartTypeTemplate::NO_OFFSET, false, 3 )); + break; + + case TEMPLATE_SCATTERLINESYMBOL: + case TEMPLATE_CUBICSPLINESCATTER: + case TEMPLATE_CUBICSPLINESCATTERSYMBOL: + case TEMPLATE_BSPLINESCATTER: + case TEMPLATE_BSPLINESCATTERSYMBOL: + case TEMPLATE_SCATTERLINE: + case TEMPLATE_SCATTERSYMBOL: + + // TEST !!! + case TEMPLATE_NET: + xTemplate.set( new DoubleStackedBarChartTypeTemplate( m_xContext, + chart2::StackMode_NONE, chart2::StackMode_STACKED )); + break; + + // TEST !!! + case TEMPLATE_NETSYMBOL: + case TEMPLATE_STACKEDNET: + case TEMPLATE_STACKEDNETSYMBOL: + xTemplate.set( new DoubleStackedBarChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED, chart2::StackMode_STACKED )); + break; + + // TEST !!! + case TEMPLATE_PERCENTSTACKEDNET: + case TEMPLATE_PERCENTSTACKEDNETSYMBOL: + xTemplate.set( new DoubleStackedBarChartTypeTemplate( m_xContext, + chart2::StackMode_STACKED_PERCENT, chart2::StackMode_STACKED )); + break; + + case TEMPLATE_STOCKLOWHIGHCLOSE: + case TEMPLATE_STOCKOPENLOWHIGHCLOSE: + case TEMPLATE_STOCKVOLUMELOWHIGHCLOSE: + case TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE: + case TEMPLATE_SURFACE: + case TEMPLATE_THREEDSCATTER: + case TEMPLATE_THREEDSCATTERSYMBOL: + case TEMPLATE_ADDIN: + break; + + case TEMPLATE_NOT_FOUND: + OSL_ASSERT( false ); + break; + } + xResult.set( xTemplate, uno::UNO_QUERY ); + } + + return xResult; +} + +uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstanceWithArguments( + const OUString& ServiceSpecifier, + const uno::Sequence< uno::Any >& Arguments ) + throw (uno::Exception, + uno::RuntimeException) +{ + OSL_ENSURE( false, "createInstanceWithArguments: No arguments supported" ); + return createInstance( ServiceSpecifier ); +} + +uno::Sequence< OUString > SAL_CALL ChartTypeManager::getAvailableServiceNames() + throw (uno::RuntimeException) +{ + ::std::vector< OUString > aServices; + const tTemplateMapType & rMap = lcl_DefaultChartTypeMap(); + aServices.reserve( rMap.size()); + + // get own default templates + ::std::transform( rMap.begin(), rMap.end(), ::std::back_inserter( aServices ), + ::std::select1st< tTemplateMapType::value_type >()); + + // add components that were registered in the context's factory + uno::Reference< container::XContentEnumerationAccess > xEnumAcc( + m_xContext->getServiceManager(), uno::UNO_QUERY ); + if( xEnumAcc.is()) + { + uno::Reference< container::XEnumeration > xEnum( + xEnumAcc->createContentEnumeration( C2U( "drafts.com.sun.star.chart2.ChartTypeTemplate" ) )); + if( xEnum.is()) + { + uno::Reference< uno::XInterface > xFactIntf; + + while( xEnum->hasMoreElements()) + { + if( xEnum->nextElement() >>= xFactIntf ) + { + uno::Reference< lang::XServiceName > xServiceName( xFactIntf, uno::UNO_QUERY ); + if( xServiceName.is()) + aServices.push_back( xServiceName->getServiceName()); + } + } + } + } + + return helper::VectorToSequence( aServices ); +} + +// ____ XServiceInfo ____ +Sequence< OUString > ChartTypeManager::getSupportedServiceNames_Static() +{ + Sequence< OUString > aServices( 3 ); + aServices[ 0 ] = C2U( "drafts.com.sun.star.chart2.ChartTypeManager" ); + aServices[ 1 ] = C2U( "drafts.com.sun.star.lang.MultiServiceFactory" ); + aServices[ 2 ] = C2U( "com.sun.star.beans.PropertySet" ); + return aServices; +} + +// ____ OPropertySet ____ +uno::Any ChartTypeManager::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static helper::tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + // initialize defaults + lcl_AddDefaultsToMap( aStaticDefaults ); + } + + helper::tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + return uno::Any(); + + return (*aFound).second; + // \-- +} + +// ____ OPropertySet ____ +::cppu::IPropertyArrayHelper & SAL_CALL ChartTypeManager::getInfoHelper() +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + + +// ____ XPropertySet ____ +uno::Reference< beans::XPropertySetInfo > SAL_CALL + ChartTypeManager::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static uno::Reference< beans::XPropertySetInfo > xInfo; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +// ================================================================================ + +using impl::ChartTypeManager_Base; + +IMPLEMENT_FORWARD_XINTERFACE2( ChartTypeManager, ChartTypeManager_Base, ::property::OPropertySet ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( ChartTypeManager, ChartTypeManager_Base, ::property::OPropertySet ) + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( ChartTypeManager, + C2U( "com.sun.star.comp.chart.ChartTypeManager" )); +} // namespace chart diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx new file mode 100644 index 000000000000..99fae630062e --- /dev/null +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -0,0 +1,727 @@ +/************************************************************************* + * + * $RCSfile: ChartTypeTemplate.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ChartTypeTemplate.hxx" +#include "PropertyHelper.hxx" +#include "algohelper.hxx" +#include "macros.hxx" +#include "ContextHelper.hxx" +#include "Scale.hxx" +#include "TitleHelper.hxx" + +#include "Diagram.hxx" +#include "Scaling.hxx" +#include "CartesianCoordinateSystem.hxx" +#include "BoundedCoordinateSystem.hxx" +#include "MeterHelper.hxx" + +#ifndef _CPPUHELPER_COMPONENT_CONTEXT_HXX_ +#include <cppuhelper/component_context.hxx> +#endif + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif +#ifndef _COM_SUN_STAR_CHART_CHARTSOLIDTYPE_HPP_ +#include <com/sun/star/chart/ChartSolidType.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTTYPEGROUP_HPP_ +#include <drafts/com/sun/star/chart2/XChartTypeGroup.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XSTACKABLESCALEGROUP_HPP_ +#include <drafts/com/sun/star/chart2/XStackableScaleGroup.hpp> +#endif + +#include <algorithm> +#include <iterator> + +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans::PropertyAttribute; +using namespace ::drafts::com::sun::star; + +using ::rtl::OUString; +using ::com::sun::star::beans::Property; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; + +// ====================================================================== + +namespace +{ +bool lcl_SetStackModeAtTree( + const Reference< chart2::XDataSeriesTreeParent > & rTree, + chart2::StackMode eMode ) +{ + if( ! rTree.is()) + return false; + + bool bResult = false; + + // seek value stacking group + Sequence< Reference< chart2::XDataSeriesTreeNode > > aChildren( rTree->getChildren()); + for( sal_Int32 i = 0; + ( ! bResult ) && ( i < aChildren.getLength() ); + ++i ) + { + Reference< chart2::XStackableScaleGroup > xStackGroup( aChildren[ i ], uno::UNO_QUERY ); + if( xStackGroup.is()) + { + Reference< lang::XServiceInfo > xServInfo( aChildren[ i ], uno::UNO_QUERY ); + if( xServInfo.is() && + xServInfo->supportsService( + C2U( "drafts.com.sun.star.chart2.ContinuousScaleGroup" ))) + { + xStackGroup->setStackMode( eMode ); + bResult = true; + break; + } + } + + // recurse + Reference< chart2::XDataSeriesTreeParent > xNewParent( aChildren[ i ], uno::UNO_QUERY ); + if( xNewParent.is() && + lcl_SetStackModeAtTree( xNewParent, eMode )) + bResult = true; + } + + return bResult; +} + +// helping method for lcl_GetDataSeries() (see below) +void lcl_AddSeriesRecursive( + Reference< chart2::XDataSeriesTreeParent > xParent, + ::std::vector< Reference< chart2::XDataSeries > > & rOutSeriesVec ) +{ + if( xParent.is()) + { + Sequence< Reference< chart2::XDataSeriesTreeNode > > aChildren( xParent->getChildren()); + for( sal_Int32 i = 0; i < aChildren.getLength(); ++i ) + { + Reference< chart2::XDataSeries > aDataSeries( aChildren[ i ], uno::UNO_QUERY ); + if( aDataSeries.is()) + { + rOutSeriesVec.push_back( aDataSeries ); + } + else + { + Reference< chart2::XDataSeriesTreeParent > xNewParent( aChildren[ i ], uno::UNO_QUERY ); + if( xNewParent.is()) + lcl_AddSeriesRecursive( xNewParent, rOutSeriesVec ); + } + } + } +} +Sequence< Reference< chart2::XDataSeries > > + lcl_GetDataSeries( const Reference< chart2::XDiagram > & xDia ) +{ + ::std::vector< Reference< chart2::XDataSeries > > aSeriesVec; + + if( xDia.is()) + { + Reference< chart2::XDataSeriesTreeParent > aParent( xDia->getTree()); + + if( aParent.is()) + lcl_AddSeriesRecursive( aParent, aSeriesVec ); + } + + return ::chart::helper::VectorToSequence( aSeriesVec ); +} + +void lcl_FlushLegend( const Reference< chart2::XLegend > & xLegend ) +{ + if( xLegend.is()) + { + Sequence< Reference< chart2::XLegendEntry > > aEntries( xLegend->getEntries()); + for( sal_Int32 i = 0; i < aEntries.getLength(); ++i ) + { + xLegend->revokeEntry( aEntries[ i ] ); + } + } +} + +#if OSL_DEBUG_LEVEL > 1 + +#include <drafts/com/sun/star/chart2/XChartTypeGroup.hpp> +#include <drafts/com/sun/star/chart2/XScaleGroup.hpp> + +// forward declatation +void lcl_ShowTree( const Reference< chart2::XDataSeriesTreeParent > & xParent, sal_Int32 nLevel = 0 ); + +#endif + +} // anonymous namespace + +namespace chart +{ + +ChartTypeTemplate::ChartTypeTemplate( + Reference< uno::XComponentContext > const & xContext ) : + m_xContext( xContext ) +{ +} + +ChartTypeTemplate::~ChartTypeTemplate() +{} + +// ____ XChartTypeTemplate ____ + +Reference< chart2::XDiagram > SAL_CALL ChartTypeTemplate::createDiagram( + const Sequence< Reference< chart2::XDataSeries > >& aSeriesSeq ) + throw (uno::RuntimeException) +{ + // create diagram + Reference< chart2::XDiagram > xDia( new Diagram( m_xContext ) ); + + // modify diagram + FillDiagram( xDia, aSeriesSeq ); + + // create and attach legend + Reference< chart2::XLegend > xLegend( + m_xContext->getServiceManager()->createInstanceWithContext( + C2U( "drafts.com.sun.star.chart2.Legend" ), + m_xContext ), + uno::UNO_QUERY ); + + xDia->setLegend( xLegend ); + fillEmptyLegend( xLegend, xDia ); + + return xDia; +} + +// simple first approach +void SAL_CALL ChartTypeTemplate::changeDiagram( const Reference< chart2::XDiagram >& xDiagram ) + throw (uno::RuntimeException) +{ + Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( lcl_GetDataSeries( xDiagram )); + FillDiagram( xDiagram, aSeriesSeq ); + + Reference< chart2::XLegend > xLegend( xDiagram->getLegend()); + lcl_FlushLegend( xLegend ); + fillEmptyLegend( xLegend, xDiagram ); +} + +// ________________________________________ + +sal_Int32 ChartTypeTemplate::getDimension() const +{ + return 2; +} + +chart2::StackMode ChartTypeTemplate::getStackMode() const +{ + return chart2::StackMode_NONE; +} + +// ________________________________________ + +Reference< chart2::XBoundedCoordinateSystem > ChartTypeTemplate::createCoordinateSystem( + const Reference< chart2::XBoundedCoordinateSystemContainer > & xCoordSysCnt ) +{ + Reference< chart2::XCoordinateSystem > xCoordSys( new CartesianCoordinateSystem( getDimension() )); + Reference< chart2::XBoundedCoordinateSystem > xResult( + new BoundedCoordinateSystem( xCoordSys )); + + chart2::ScaleData aScale; + aScale.Orientation = chart2::AxisOrientation_MATHEMATICAL; + aScale.Scaling = new LinearScaling( 1.0, 0.0 ); + + for( sal_Int32 i = 0; i < getDimension(); ++i ) + xResult->setScaleByDimension( + i, Reference< chart2::XScale >( new Scale( m_xContext, aScale ) )); + + try + { + if( xCoordSys.is()) + xCoordSysCnt->addCoordinateSystem( xResult ); + } + catch( lang::IllegalArgumentException ex ) + { + ASSERT_EXCEPTION( ex ); + } + + return xResult; +} + +void ChartTypeTemplate::createAndAddAxes( + const Reference< chart2::XBoundedCoordinateSystem > & rCoordSys, + const Reference< chart2::XAxisContainer > & rOutAxisCnt ) +{ + if( rCoordSys.is() && rOutAxisCnt.is()) + { + // create axes + Reference< chart2::XAxis > aAxis; + sal_Int32 nDim = rCoordSys->getDimension(), + i = 0; + + for( ; i < nDim; ++i ) + MeterHelper::createAxis( i, rCoordSys, rOutAxisCnt, m_xContext ); + } +} + +void ChartTypeTemplate::createAndAddGrids( + const Reference< chart2::XBoundedCoordinateSystem > & rCoordSys, + const Reference< chart2::XGridContainer > & rOutGridCnt ) +{ + // just add one y-grid + static const sal_Int32 nGridDim = 1; + + if( rOutGridCnt.is() && + rCoordSys.is() && + rCoordSys->getDimension() >= 2 ) + { + ContextHelper::tContextEntryMapType aContextValues( + ContextHelper::MakeContextEntryMap + ( C2U( "Identifier" ), uno::makeAny( MeterHelper::makeGridIdentifier( 1, 0, true ) )) + ); + + Reference< chart2::XGrid > xGrid( + m_xContext->getServiceManager()->createInstanceWithContext( + C2U( "drafts.com.sun.star.chart2.Grid" ), + ContextHelper::createContext( aContextValues, m_xContext ) ), + uno::UNO_QUERY ); + + if( xGrid.is()) + { + // try to share XIncrement with axis + Reference< chart2::XAxisContainer > xAxisCnt( rOutGridCnt, uno::UNO_QUERY ); + if( xAxisCnt.is()) + { + Sequence< Reference< chart2::XAxis > > aAxes( xAxisCnt->getAxes()); + for( sal_Int32 i = 0; i < aAxes.getLength(); ++i ) + { + if( aAxes[i].is() && + aAxes[i]->getRepresentedDimension() == nGridDim && + aAxes[i]->getCoordinateSystem() == rCoordSys ) + { + xGrid->setIncrement( aAxes[i]->getIncrement()); + break; + } + } + } + + xGrid->attachCoordinateSystem( rCoordSys, nGridDim ); + rOutGridCnt->addGrid( xGrid ); + } + } +} + +void ChartTypeTemplate::FillDiagram( + const Reference< chart2::XDiagram >& xDiagram, + const Sequence< Reference< chart2::XDataSeries > >& aSeriesSeq ) +{ + Reference< chart2::XBoundedCoordinateSystemContainer > xCoordSysCnt( xDiagram, uno::UNO_QUERY ); + // scales + Reference< chart2::XBoundedCoordinateSystem > xCoordSys( createCoordinateSystem( xCoordSysCnt )); + + // data series tree + Reference< chart2::XDataSeriesTreeParent > xTree( + createDataSeriesTree( aSeriesSeq, xCoordSys)); + xDiagram->setTree( xTree ); + +#if OSL_DEBUG_LEVEL > 1 + lcl_ShowTree( xTree ); +#endif + + // set stacking mode +// sal_Int32 nStyle = CHSTYLE_ADDIN; +// getFastPropertyValue( PROP_CHARTTYPE_CHART_TEMPLATE_NAME ) >>= nStyle; +// SetStackModeAtTree( xTree, lcl_GetStackModeForChartStyle( +// static_cast< ChartStyle >( nStyle ) )); + + // axes + Reference< chart2::XAxisContainer > xAxisCnt( xDiagram, uno::UNO_QUERY ); + OSL_ASSERT( xAxisCnt.is()); + if( xAxisCnt.is()) + { + // remove formerly existing axes + Sequence< Reference< chart2::XAxis > > aAxes( xAxisCnt->getAxes() ); + sal_Int32 i = 0; + for( ; i < aAxes.getLength(); ++i ) + { + xAxisCnt->removeAxis( aAxes[ i ] ); + } + + createAndAddAxes( xCoordSys, xAxisCnt ); + } + + // grid + Reference< chart2::XGridContainer > xGridCnt( xDiagram, uno::UNO_QUERY ); + if( xGridCnt.is()) + { + Sequence< Reference< chart2::XGrid > > aGrids( xGridCnt->getGrids() ); + sal_Int32 i = 0; + for( ; i < aGrids.getLength(); ++i ) + { + xGridCnt->removeGrid( aGrids[ i ] ); + } + + createAndAddGrids( xCoordSys, xGridCnt ); + } +} + +Reference< chart2::XDataSeriesTreeParent > ChartTypeTemplate::createRootNode() +{ + Reference< chart2::XDataSeriesTreeParent > aRoot( + m_xContext->getServiceManager()->createInstanceWithContext( + C2U( "drafts.com.sun.star.chart2.DataSeriesTree" ), m_xContext ), + uno::UNO_QUERY ); + OSL_ASSERT( aRoot.is()); + + return aRoot; +} + +Reference< chart2::XDataSeriesTreeNode > ChartTypeTemplate::createChartTypeGroup( + const Reference< chart2::XChartType > & xChartType ) +{ + Reference< chart2::XDataSeriesTreeNode > aChartTypeNode( + m_xContext->getServiceManager()->createInstanceWithContext( + C2U( "drafts.com.sun.star.chart2.ChartTypeGroup" ), m_xContext ), + uno::UNO_QUERY ); + OSL_ASSERT( aChartTypeNode.is()); + Reference< chart2::XChartTypeGroup > aChartTypeGroup( aChartTypeNode, uno::UNO_QUERY ); + OSL_ASSERT( aChartTypeGroup.is()); + aChartTypeGroup->setChartType( xChartType ); + + return aChartTypeNode; +} + +void ChartTypeTemplate::addDataSeriesToGroup( + const Reference< chart2::XDataSeriesTreeNode > & rParent, + const Sequence< Reference< chart2::XDataSeries > > & rDataSeries ) +{ + Reference< chart2::XDataSeriesTreeParent > xParent( rParent, uno::UNO_QUERY ); + OSL_ASSERT( xParent.is()); + if( xParent.is()) + { + const sal_Int32 nSeriesCount = rDataSeries.getLength(); + sal_Int32 i = 0; + for( i = 0; i < nSeriesCount; ++i ) + { + Reference< chart2::XDataSeriesTreeNode > xNode( rDataSeries[ i ], uno::UNO_QUERY ); + xParent->addChild( xNode ); + } + } +} + + +Reference< chart2::XDataSeriesTreeNode > ChartTypeTemplate::createScaleGroup( + bool bIsDiscrete, + bool bIsStackable, + Reference< chart2::XBoundedCoordinateSystem > xCoordSys, + sal_Int32 nRepresentedDimension, + chart2::StackMode eStackMode /* = chart2::StackMode_NONE */ ) +{ + ContextHelper::tContextEntryMapType aContextValues( + ContextHelper::MakeContextEntryMap + ( C2U( "CoordinateSystem" ), uno::makeAny( xCoordSys ) ) + ( C2U( "RepresentedDimension" ), uno::makeAny( sal_Int32( nRepresentedDimension ) ) ) + ); + + Reference< chart2::XDataSeriesTreeNode > aNode; + ::rtl::OUString aServiceName; + + if( bIsDiscrete ) + { + if( bIsStackable ) + aServiceName = C2U( "drafts.com.sun.star.chart2.DiscreteStackableScaleGroup" ); + else + aServiceName = C2U( "drafts.com.sun.star.chart2.DiscreteScaleGroup" ); + } + else + { + if( bIsStackable ) + aServiceName = C2U( "drafts.com.sun.star.chart2.ContinuousStackableScaleGroup" ); + else + aServiceName = C2U( "drafts.com.sun.star.chart2.ContinuousScaleGroup" ); + } + + aNode.set( + m_xContext->getServiceManager()->createInstanceWithContext( + aServiceName, + ContextHelper::createContext( aContextValues, m_xContext )), + uno::UNO_QUERY ); + + OSL_ASSERT( aNode.is()); + + Reference< chart2::XStackableScaleGroup > aStackGroup( aNode, uno::UNO_QUERY ); + if( aStackGroup.is()) + aStackGroup->setStackMode( eStackMode ); + + return aNode; +} + +void ChartTypeTemplate::attachNodeToNode( + const Reference< chart2::XDataSeriesTreeNode > & rParent, + const Reference< chart2::XDataSeriesTreeNode > & rChild ) +{ + Reference< chart2::XDataSeriesTreeParent > xParent( rParent, uno::UNO_QUERY ); + OSL_ASSERT( xParent.is()); + if( xParent.is()) + xParent->addChild( rChild ); +} + +Reference< chart2::XDataSeriesTreeParent > ChartTypeTemplate::createDataSeriesTree( + const Sequence< Reference< chart2::XDataSeries > > & aSeriesSeq, + const Reference< chart2::XBoundedCoordinateSystem > & rCoordSys ) +{ + // create series tree nodes + // root + Reference< chart2::XDataSeriesTreeParent > aRoot( createRootNode()); + + // chart type group + Reference< chart2::XDataSeriesTreeNode > aChartTypeNode( + createChartTypeGroup( getChartTypeForAdditionalSeries())); + + // 'x-axis' group + Reference< chart2::XDataSeriesTreeNode > aCategoryNode( + createScaleGroup( true, true, rCoordSys, 0, chart2::StackMode_STACKED )); + + // 'y-axis' group + Reference< chart2::XDataSeriesTreeNode > aValueNode( + createScaleGroup( false, true, rCoordSys, 1, getStackMode() )); + + // build tree + // add series node to value node + addDataSeriesToGroup( aValueNode, aSeriesSeq ); + + // add value node to category node + attachNodeToNode( aCategoryNode, aValueNode ); + + // add category node to chart type node + attachNodeToNode( aChartTypeNode, aCategoryNode ); + + // add chart type node to root of tree + aRoot->addChild( aChartTypeNode ); + + return aRoot; +} + +// finds all chart type groups in the given diagram tree and adds them to the +// legend +void ChartTypeTemplate::fillEmptyLegend( + const Reference< chart2::XLegend > & xLegend, + const Reference< chart2::XDiagram > & xDiagram ) +{ + if( xLegend.is() && + xDiagram.is() ) + { + Reference< chart2::XDataSeriesTreeParent > xRoot( xDiagram->getTree()); + + Sequence< Reference< chart2::XDataSeriesTreeNode > > aChildren( xRoot->getChildren()); + for( sal_Int32 i = 0; i < aChildren.getLength(); ++i ) + { + Reference< lang::XServiceInfo > xInfo( aChildren[ i ], uno::UNO_QUERY ); + if( xInfo.is() && + xInfo->supportsService( C2U( "drafts.com.sun.star.chart2.ChartTypeGroup" ))) + { + Reference< chart2::XLegendEntry > xEntry( xInfo, uno::UNO_QUERY ); + if( xEntry.is()) + xLegend->registerEntry( xEntry ); + } + } + } +} + +void ChartTypeTemplate::setStackModeAtTree( + const Reference< chart2::XDataSeriesTreeParent > & rTree, + chart2::StackMode eMode ) +{ + bool bResult = lcl_SetStackModeAtTree( rTree, eMode ); + OSL_ENSURE( bResult, "stack-mode could not be set" ); +} + +// ________ + +Sequence< OUString > ChartTypeTemplate::getSupportedServiceNames_Static() +{ + Sequence< OUString > aServices( 3 ); + aServices[ 0 ] = C2U( "drafts.com.sun.star.chart2.ChartTypeTemplate" ); + aServices[ 1 ] = C2U( "drafts.com.sun.star.layout.LayoutElement" ); + aServices[ 2 ] = C2U( "com.sun.star.beans.PropertySet" ); + return aServices; +} + +Reference< uno::XComponentContext > ChartTypeTemplate::GetComponentContext() const +{ + return m_xContext; +} + +// ================================================================================ + +// implement XServiceInfo methods basing upon getSupportedServiceNames_Static +APPHELPER_XSERVICEINFO_IMPL( ChartTypeTemplate, + C2U( "com.sun.star.comp.chart.ChartTypeTemplate" )); +} // namespace chart + +// ____ DEBUG helper ____ + +#if OSL_DEBUG_LEVEL > 1 +namespace +{ + +// prints the data series tree +void lcl_ShowTree( const Reference< chart2::XDataSeriesTreeParent > & xParent, sal_Int32 nLevel ) +{ + if( nLevel == 0 ) + { + OSL_TRACE( "DataSeriesTree" ); + OSL_TRACE( "--------------" ); + } + + if( xParent.is()) + { +// char aIndent[ nLevel * 4 + 1]; + char aIndent[ 200 ]; + // avoids including any C-headers + for( int j = 0; j < nLevel * 4; ++j ) + aIndent[j] = ' '; + aIndent[j] = '\0'; + + Sequence< Reference< chart2::XDataSeriesTreeNode > > aChildren( xParent->getChildren()); + for( sal_Int32 i = 0; i < aChildren.getLength(); ++i ) + { + Reference< lang::XServiceInfo > xInfo( aChildren[ i ], uno::UNO_QUERY ); + if( xInfo.is()) + { + Reference< chart2::XStackableScaleGroup > xStackableGroup( xInfo, uno::UNO_QUERY ); + Reference< chart2::XScaleGroup > xScaleGroup( xInfo, uno::UNO_QUERY ); + bool bIsDiscrete = ( xInfo->supportsService( + C2U( "drafts.com.sun.star.chart2.DiscreteScaleGroup" )) || + xInfo->supportsService( + C2U( "drafts.com.sun.star.chart2.DiscreteStackableScaleGroup" ))); + + if( xStackableGroup.is()) + { + if( xStackableGroup.is()) + { + OSL_TRACE( "%s<%s stackable scale group> (Dim %d, %s)", + aIndent, + bIsDiscrete ? "discrete" : "continuous", + xStackableGroup->getRepresentedDimension(), + ( xStackableGroup->getStackMode() == chart2::StackMode_NONE ) + ? "unstacked" + : ( xStackableGroup->getStackMode() == chart2::StackMode_STACKED ) + ? "stacked" + : "percent stacked" ); + } + else + { + OSL_TRACE( "%s<stackable scale group>", aIndent ); + } + } + else if( xScaleGroup.is()) + { + if( xStackableGroup.is()) + { + OSL_TRACE( "%s<%s scale group> (Dim %d)", + aIndent, + bIsDiscrete ? "discrete" : "continuous", + xScaleGroup->getRepresentedDimension() ); + } + else + { + OSL_TRACE( "%s<scale group>", aIndent ); + } + } + else if( xInfo->supportsService( C2U( "drafts.com.sun.star.chart2.ChartTypeGroup" ))) + { + Reference< chart2::XChartTypeGroup > xGroup( xInfo, uno::UNO_QUERY ); + if( xGroup.is() ) + { + OSL_TRACE( "%s<chart type group> (%s)", aIndent, U2C( xGroup->getChartType()->getChartType()) ); + } + else + { + OSL_TRACE( "%s<chart type group>", aIndent ); + } + } + else if( xInfo->supportsService( C2U( "drafts.com.sun.star.chart2.DataSeries" ))) + { + Reference< beans::XPropertySet > xProp( xInfo, uno::UNO_QUERY ); + ::rtl::OUString aId; + if( xProp.is() && + ( xProp->getPropertyValue( C2U( "Identifier" )) >>= aId )) + { + OSL_TRACE( "%s<data series> (%s)", aIndent, U2C( aId )); + } + else + { + OSL_TRACE( "%s<data series>", aIndent ); + } + } + else + { + OSL_TRACE( "%s<unknown Node>", aIndent ); + } + } + else + { + OSL_TRACE( "%s<unknown Node>", aIndent ); + } + + Reference< chart2::XDataSeriesTreeParent > xNewParent( aChildren[ i ], uno::UNO_QUERY ); + if( xNewParent.is()) + lcl_ShowTree( xNewParent, nLevel + 1 ); + } + } +} +} // anonymous namespace +#endif diff --git a/chart2/source/model/template/ChartTypeTemplate.hxx b/chart2/source/model/template/ChartTypeTemplate.hxx new file mode 100644 index 000000000000..10b330a9b6a7 --- /dev/null +++ b/chart2/source/model/template/ChartTypeTemplate.hxx @@ -0,0 +1,274 @@ +/************************************************************************* + * + * $RCSfile: ChartTypeTemplate.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_CHARTTYPETEMPLATE_HXX +#define CHART_CHARTTYPETEMPLATE_HXX + +#ifndef _CPPUHELPER_IMPLBASE1_HXX_ +#include <cppuhelper/implbase1.hxx> +#endif +#include "ServiceMacros.hxx" + +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTTYPETEMPLATE_HPP_ +#include <drafts/com/sun/star/chart2/XChartTypeTemplate.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XAXISCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XAxisContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_STACKMODE_HPP_ +#include <drafts/com/sun/star/chart2/StackMode.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XGRIDCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XGridContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XBOUNDEDCOORDINATESYSTEMCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XBoundedCoordinateSystemContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XLEGEND_HPP_ +#include <drafts/com/sun/star/chart2/XLegend.hpp> +#endif + +namespace chart +{ + +class ChartTypeTemplate : public ::cppu::WeakImplHelper1< + ::drafts::com::sun::star::chart2::XChartTypeTemplate > +{ +public: + explicit ChartTypeTemplate( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext ); + virtual ~ChartTypeTemplate(); + + APPHELPER_XSERVICEINFO_DECL() + /// establish methods for factory instatiation +// APPHELPER_SERVICE_FACTORY_HELPER( ChartTypeTemplate ) + +protected: + // ____ XChartTypeTemplate ____ + // still abstract ! + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartType > SAL_CALL getChartTypeForAdditionalSeries() + throw (::com::sun::star::uno::RuntimeException) = 0; + virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XDiagram > SAL_CALL + createDiagram( const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeries > >& aSeriesSeq ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL changeDiagram( + const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XDiagram >& xDiagram ) + throw (::com::sun::star::uno::RuntimeException); + + // Methods to overload for automatic creation + // ------------------------------------------ + + /// returns 2 by default. Supported are 2 and 3 + virtual sal_Int32 getDimension() const; + + /** returns StackMode_NONE by default. This is a global flag used for all series + if createDataSeriesTree() is not overloaded + */ + virtual ::drafts::com::sun::star::chart2::StackMode getStackMode() const; + + // Methods for creating the diagram piecewise + // ------------------------------------------ + + /** Creates a 2d or 3d cartesian coordinate system with mathematically + oriented, linear scales with auto-min/max. + + <p>The dimension depends on the property "ChartStyle".</p> + + @param xCoordSysCnt + If this container is valid, the coordinate system is added to it. + */ + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > + createCoordinateSystem( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystemContainer > & xCoordSysCnt ); + + /** create axes and add them to the given container. + + <p>As default, this method creates as many axes as there are dimensions + in the given coordinate system. Each of the axis represents one of the + dimensions of the coordinate system.</p> + */ + virtual void createAndAddAxes( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > & rCoordSys, + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XAxisContainer > & rOutAxisCnt ); + + /** create grids and add them to the given container. + + <p>As default, this method creates a major grid for the second + coordinate of the coordinate system.</p> + */ + virtual void createAndAddGrids( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > & rCoordSys, + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XGridContainer > & rOutGridCnt ); + + /** create a data series tree, that fits the requirements of the chart type. + + <p>As default, this creates a tree with the following structure:</p> + + <pre> + root + | + +-- chart type + | + +-- category (DiscreteStackableScaleGroup using scale 0) + | + +-- values (ContinuousStackableScaleGroup using scale 1) + | + +-- series 0 + | + +-- series 1 + | + ... + | + +.. series n-1 + </pre> + + <p>If there are less than two scales available the returned tree is + empty.</p> + */ + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeriesTreeParent > createDataSeriesTree( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeries > >& aSeriesSeq, + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > & rCoordSys + ); + + virtual void fillEmptyLegend( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XLegend > & xLegend, + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDiagram > & xDiagram ); + + // helper methods + // -------------- + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeriesTreeParent > createRootNode(); + + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeriesTreeNode > + createChartTypeGroup( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartType > & xChartType ); + + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeriesTreeNode > + createScaleGroup( bool bIsDiscrete, + bool bIsStackable, + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > xCoordSys, + sal_Int32 nRepresentedDimension, + ::drafts::com::sun::star::chart2::StackMode eStackMode = + ::drafts::com::sun::star::chart2::StackMode_NONE ); + + void addDataSeriesToGroup( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeriesTreeNode > & rParent, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeries > > & rDataSeries ); + + /** Finds the first ContinuousScaleGroup in the tree and sets the stacking + mode there if it is a stackable group + */ + void setStackModeAtTree( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeriesTreeParent > & rTree, + ::drafts::com::sun::star::chart2::StackMode eMode ); + + void attachNodeToNode( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeriesTreeNode > & rParent, + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeriesTreeNode > & rChild ); + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + GetComponentContext() const; + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + m_xContext; + + /** modifies the given diagram + */ + void FillDiagram( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDiagram > & xDiagram, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeries > >& aSeriesSeq ); +}; + +} // namespace chart + +// CHART_CHARTTYPETEMPLATE_HXX +#endif diff --git a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx new file mode 100644 index 000000000000..4a264b6d1a66 --- /dev/null +++ b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx @@ -0,0 +1,175 @@ +/************************************************************************* + * + * $RCSfile: ColumnLineChartTypeTemplate.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ColumnLineChartTypeTemplate.hxx" +#include "macros.hxx" +#include "LineChartType.hxx" +#include "BarChartType.hxx" + +#include <algorithm> + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; +using ::rtl::OUString; + +namespace chart +{ + +ColumnLineChartTypeTemplate::ColumnLineChartTypeTemplate( + Reference< + uno::XComponentContext > const & xContext, + chart2::StackMode eStackMode, + sal_Int32 nNumberOfLines ) : + ChartTypeTemplate( xContext ), + m_eStackMode( eStackMode ), + m_nNumberOfLines( nNumberOfLines ) +{} + +ColumnLineChartTypeTemplate::~ColumnLineChartTypeTemplate() +{} + +Reference< chart2::XDataSeriesTreeParent > ColumnLineChartTypeTemplate::createDataSeriesTree( + const Sequence< Reference< chart2::XDataSeries > > & aSeriesSeq, + const Reference< chart2::XBoundedCoordinateSystem > & rCoordSys ) +{ + // create series tree nodes + // root + Reference< chart2::XDataSeriesTreeParent > aRoot( createRootNode()); + + sal_Int32 nNumberOfBars = aSeriesSeq.getLength(); + sal_Int32 nNumberOfLines = m_nNumberOfLines; + if( nNumberOfLines >= nNumberOfBars ) + { + nNumberOfLines = 1; + nNumberOfBars -= 1; + } + else + nNumberOfBars -= nNumberOfLines; + + // Bars + // ---- + // chart type group + Reference< chart2::XDataSeriesTreeNode > aBarNode( + createChartTypeGroup( new BarChartType() )); + + // 'x-axis' group + Reference< chart2::XDataSeriesTreeNode > aBarCategoryNode( + createScaleGroup( true, true, rCoordSys, 0, chart2::StackMode_STACKED )); + + // 'y-axis' group + Reference< chart2::XDataSeriesTreeNode > aBarValueNode( + createScaleGroup( false, true, rCoordSys, 1, m_eStackMode )); + + // Lines + // ----- + // chart type group + Reference< chart2::XDataSeriesTreeNode > aLineNode( + createChartTypeGroup( new LineChartType() )); + + // 'x-axis' group + Reference< chart2::XDataSeriesTreeNode > aLineCategoryNode( + createScaleGroup( true, false, rCoordSys, 0, chart2::StackMode_STACKED )); + + // 'y-axis' group + Reference< chart2::XDataSeriesTreeNode > aLineValueNode( + createScaleGroup( false, false, rCoordSys, 1, chart2::StackMode_NONE )); + + // Build Tree + // ---------- + + // add series node to value nodes + Sequence< Reference< chart2::XDataSeries > > aBarSeq( nNumberOfBars ); + ::std::copy( aSeriesSeq.getConstArray(), + aSeriesSeq.getConstArray() + nNumberOfBars, + aBarSeq.getArray()); + addDataSeriesToGroup( aBarValueNode, aBarSeq ); + + Sequence< Reference< chart2::XDataSeries > > aLineSeq( nNumberOfLines ); + ::std::copy( aSeriesSeq.getConstArray() + nNumberOfBars, + aSeriesSeq.getConstArray() + aSeriesSeq.getLength(), + aLineSeq.getArray()); + addDataSeriesToGroup( aLineValueNode, aLineSeq ); + + // add value nodes to category nodes + attachNodeToNode( aBarCategoryNode, aBarValueNode ); + attachNodeToNode( aLineCategoryNode, aLineValueNode ); + + // add category node to chart type node + attachNodeToNode( aBarNode, aBarCategoryNode ); + attachNodeToNode( aLineNode, aLineCategoryNode ); + + // add chart type nodes to root of tree + aRoot->addChild( aBarNode ); + aRoot->addChild( aLineNode ); + + return aRoot; +} + +// ____ XChartTypeTemplate ____ +uno::Reference< chart2::XChartType > SAL_CALL ColumnLineChartTypeTemplate::getChartTypeForAdditionalSeries() + throw (uno::RuntimeException) +{ + return new LineChartType(); +} + +} // namespace chart diff --git a/chart2/source/model/template/ColumnLineChartTypeTemplate.hxx b/chart2/source/model/template/ColumnLineChartTypeTemplate.hxx new file mode 100644 index 000000000000..fed23a93aefc --- /dev/null +++ b/chart2/source/model/template/ColumnLineChartTypeTemplate.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * $RCSfile: ColumnLineChartTypeTemplate.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_COLUMNLINECHARTTYPETEMPLATE_HXX +#define CHART_COLUMNLINECHARTTYPETEMPLATE_HXX + +#include "ChartTypeTemplate.hxx" + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_STACKMODE_HPP_ +#include <drafts/com/sun/star/chart2/StackMode.hpp> +#endif + +namespace chart +{ + +class ColumnLineChartTypeTemplate : public ChartTypeTemplate +{ +public: + explicit ColumnLineChartTypeTemplate( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext, + ::drafts::com::sun::star::chart2::StackMode eStackMode, + sal_Int32 nNumberOfLines ); + virtual ~ColumnLineChartTypeTemplate(); + +protected: + // ____ XChartTypeTemplate ____ + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartType > SAL_CALL getChartTypeForAdditionalSeries() + throw (::com::sun::star::uno::RuntimeException); + + // ____ ChartTypeTemplate ____ + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeriesTreeParent > createDataSeriesTree( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeries > >& aSeriesSeq, + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > & rCoordSys + ); + +private: + ::drafts::com::sun::star::chart2::StackMode + m_eStackMode; + sal_Int32 m_nNumberOfLines; +}; + +} // namespace chart + +// CHART_COLUMNLINECHARTTYPETEMPLATE_HXX +#endif diff --git a/chart2/source/model/template/LineChartType.cxx b/chart2/source/model/template/LineChartType.cxx new file mode 100644 index 000000000000..b4c366ac2454 --- /dev/null +++ b/chart2/source/model/template/LineChartType.cxx @@ -0,0 +1,83 @@ +/************************************************************************* + * + * $RCSfile: LineChartType.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "LineChartType.hxx" + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +namespace chart +{ + +LineChartType::LineChartType( sal_Int32 nDim /* = 2 */ ) : + ChartType( nDim ) +{} + +LineChartType::~LineChartType() +{} + +// ____ XChartType ____ +::rtl::OUString SAL_CALL LineChartType::getChartType() + throw (uno::RuntimeException) +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.LineChart" )); +} + +} // namespace chart diff --git a/chart2/source/model/template/LineChartType.hxx b/chart2/source/model/template/LineChartType.hxx new file mode 100644 index 000000000000..8dd307702d81 --- /dev/null +++ b/chart2/source/model/template/LineChartType.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * $RCSfile: LineChartType.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_LINECHARTTYPE_HXX +#define CHART_LINECHARTTYPE_HXX + +#include "ChartType.hxx" + +namespace chart +{ + +class LineChartType : public ChartType +{ +public: + LineChartType( sal_Int32 nDim = 2 ); + virtual ~LineChartType(); + +protected: + // ____ XChartType ____ + virtual ::rtl::OUString SAL_CALL getChartType() + throw (::com::sun::star::uno::RuntimeException); +}; + +} // namespace chart + +// CHART_LINECHARTTYPE_HXX +#endif diff --git a/chart2/source/model/template/LineChartTypeTemplate.cxx b/chart2/source/model/template/LineChartTypeTemplate.cxx new file mode 100644 index 000000000000..1334b365c4bc --- /dev/null +++ b/chart2/source/model/template/LineChartTypeTemplate.cxx @@ -0,0 +1,104 @@ +/************************************************************************* + * + * $RCSfile: LineChartTypeTemplate.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "LineChartTypeTemplate.hxx" +#include "LineChartType.hxx" + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +namespace chart +{ + +LineChartTypeTemplate::LineChartTypeTemplate( + uno::Reference< + uno::XComponentContext > const & xContext, + chart2::StackMode eStackMode, + SplineMode eSplineMode, + bool bSymbols, + sal_Int32 nDim /* = 2 */ ) : + ChartTypeTemplate( xContext ), + m_eStackMode( eStackMode ), + m_eSplineMode( eSplineMode ), + m_bHasSymbols( bSymbols ), + m_nDim( nDim ) +{} + +LineChartTypeTemplate::~LineChartTypeTemplate() +{} + +sal_Int32 LineChartTypeTemplate::getDimension() const +{ + return m_nDim; +} + +chart2::StackMode LineChartTypeTemplate::getStackMode() const +{ + return m_eStackMode; +} + +// ____ XChartTypeTemplate ____ +uno::Reference< chart2::XChartType > SAL_CALL LineChartTypeTemplate::getChartTypeForAdditionalSeries() + throw (uno::RuntimeException) +{ + return new LineChartType( m_nDim ); +} + +} // namespace chart diff --git a/chart2/source/model/template/LineChartTypeTemplate.hxx b/chart2/source/model/template/LineChartTypeTemplate.hxx new file mode 100644 index 000000000000..d8c2c939192c --- /dev/null +++ b/chart2/source/model/template/LineChartTypeTemplate.hxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * $RCSfile: LineChartTypeTemplate.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_LINECHARTTYPETEMPLATE_HXX +#define CHART_LINECHARTTYPETEMPLATE_HXX + +#include "ChartTypeTemplate.hxx" + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_STACKMODE_HPP_ +#include <drafts/com/sun/star/chart2/StackMode.hpp> +#endif + +namespace chart +{ + +class LineChartTypeTemplate : public ChartTypeTemplate +{ +public: + enum SplineMode + { + NO_SPLINE, + CUBIC_SPLINE, + B_SPLINE + }; + + explicit LineChartTypeTemplate( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext, + ::drafts::com::sun::star::chart2::StackMode eStackMode, SplineMode eSplineMode, + bool bSymbols, sal_Int32 nDim = 2 ); + virtual ~LineChartTypeTemplate(); + +protected: + // ____ ChartTypeTemplate ____ + virtual sal_Int32 getDimension() const; + virtual ::drafts::com::sun::star::chart2::StackMode getStackMode() const; + + // ____ XChartTypeTemplate ____ + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartType > SAL_CALL getChartTypeForAdditionalSeries() + throw (::com::sun::star::uno::RuntimeException); + +private: + ::drafts::com::sun::star::chart2::StackMode + m_eStackMode; + SplineMode m_eSplineMode; + bool m_bHasSymbols; + sal_Int32 m_nDim; +}; + +} // namespace chart + +// CHART_LINECHARTTYPETEMPLATE_HXX +#endif diff --git a/chart2/source/model/template/PieChartType.cxx b/chart2/source/model/template/PieChartType.cxx new file mode 100644 index 000000000000..afc3247c3d76 --- /dev/null +++ b/chart2/source/model/template/PieChartType.cxx @@ -0,0 +1,220 @@ +/************************************************************************* + * + * $RCSfile: PieChartType.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "PieChartType.hxx" +#include "PropertyHelper.hxx" +#include "algohelper.hxx" +#include "macros.hxx" + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +using ::rtl::OUString; +using ::com::sun::star::beans::Property; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::osl::MutexGuard; + +namespace +{ + +enum +{ + PROP_PIECHARTTYPE_DIMENSION, + PROP_PIECHARTTYPE_OFFSET +}; + +void lcl_AddPropertiesToVector( + ::std::vector< Property > & rOutProperties ) +{ + rOutProperties.push_back( + Property( C2U( "Dimension" ), + PROP_PIECHARTTYPE_DIMENSION, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); + + rOutProperties.push_back( + Property( C2U( "Offset" ), + PROP_PIECHARTTYPE_OFFSET, + ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); +} + +void lcl_AddDefaultsToMap( + ::chart::helper::tPropertyValueMap & rOutMap ) +{ + // must match default in CTOR! + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_PIECHARTTYPE_DIMENSION )); + rOutMap[ PROP_PIECHARTTYPE_DIMENSION ] = + uno::makeAny( sal_Int32( 2 ) ); + + OSL_ASSERT( rOutMap.end() == rOutMap.find( PROP_PIECHARTTYPE_OFFSET )); + rOutMap[ PROP_PIECHARTTYPE_OFFSET ] = + uno::makeAny( sal_Int32( 0 ) ); +} + +const Sequence< Property > & lcl_GetPropertySequence() +{ + static Sequence< Property > aPropSeq; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aPropSeq.getLength() ) + { + // get properties + ::std::vector< ::com::sun::star::beans::Property > aProperties; + lcl_AddPropertiesToVector( aProperties ); + + // and sort them for access via bsearch + ::std::sort( aProperties.begin(), aProperties.end(), + ::chart::helper::PropertyNameLess() ); + + // transfer result to static Sequence + aPropSeq = ::chart::helper::VectorToSequence( aProperties ); + } + + return aPropSeq; +} + +} // anonymous namespace + +namespace chart +{ + +PieChartType::PieChartType( + sal_Int32 nDim /* = 2 */, + sal_Int32 nOffset /* = 0 */ ) : + ChartType( nDim ) +{ + setFastPropertyValue_NoBroadcast( PROP_PIECHARTTYPE_OFFSET, uno::makeAny( nOffset )); +} + +PieChartType::~PieChartType() +{} + +// ____ XChartType ____ +::rtl::OUString SAL_CALL PieChartType::getChartType() + throw (uno::RuntimeException) +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.PieChart" )); +} + + +// ____ OPropertySet ____ +uno::Any PieChartType::GetDefaultValue( sal_Int32 nHandle ) const + throw(beans::UnknownPropertyException) +{ + static helper::tPropertyValueMap aStaticDefaults; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( 0 == aStaticDefaults.size() ) + { + // initialize defaults + lcl_AddDefaultsToMap( aStaticDefaults ); + } + + helper::tPropertyValueMap::const_iterator aFound( + aStaticDefaults.find( nHandle )); + + if( aFound == aStaticDefaults.end()) + return uno::Any(); + + return (*aFound).second; + // \-- +} + +// ____ OPropertySet ____ +::cppu::IPropertyArrayHelper & SAL_CALL PieChartType::getInfoHelper() +{ + static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(), + /* bSorted = */ sal_True ); + + return aArrayHelper; +} + + +// ____ XPropertySet ____ +uno::Reference< beans::XPropertySetInfo > SAL_CALL + PieChartType::getPropertySetInfo() + throw (uno::RuntimeException) +{ + static uno::Reference< beans::XPropertySetInfo > xInfo; + + // /-- + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if( !xInfo.is()) + { + xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo( + getInfoHelper()); + } + + return xInfo; + // \-- +} + +} // namespace chart diff --git a/chart2/source/model/template/PieChartType.hxx b/chart2/source/model/template/PieChartType.hxx new file mode 100644 index 000000000000..2e389f6e137a --- /dev/null +++ b/chart2/source/model/template/PieChartType.hxx @@ -0,0 +1,97 @@ +/************************************************************************* + * + * $RCSfile: PieChartType.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_PIECHARTTYPE_HXX +#define CHART_PIECHARTTYPE_HXX + +#include "ChartType.hxx" + +namespace chart +{ + +class PieChartType : public ChartType +{ +public: + PieChartType( sal_Int32 nDim = 2, + sal_Int32 nOffset = 0 ); + virtual ~PieChartType(); + +protected: + // ____ XChartType ____ + virtual ::rtl::OUString SAL_CALL getChartType() + throw (::com::sun::star::uno::RuntimeException); + + // ____ OPropertySet ____ + virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const + throw(::com::sun::star::beans::UnknownPropertyException); + + // ____ OPropertySet ____ + virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); + + // ____ XPropertySet ____ + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); +}; + +} // namespace chart + +// CHART_PIECHARTTYPE_HXX +#endif diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx new file mode 100644 index 000000000000..01037b7d4d8c --- /dev/null +++ b/chart2/source/model/template/PieChartTypeTemplate.cxx @@ -0,0 +1,222 @@ +/************************************************************************* + * + * $RCSfile: PieChartTypeTemplate.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "PieChartTypeTemplate.hxx" +#include "PolarCoordinateSystem.hxx" +#include "BoundedCoordinateSystem.hxx" +#include "Scaling.hxx" +#include "PieChartType.hxx" +#include "Scale.hxx" +#include "macros.hxx" + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star; + +using ::rtl::OUString; +using ::com::sun::star::beans::Property; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::osl::MutexGuard; + +namespace chart +{ + +PieChartTypeTemplate::PieChartTypeTemplate( + uno::Reference< + uno::XComponentContext > const & xContext, + PieOffsetMode eMode, + bool bRings /* = false */, + sal_Int32 nDim /* = 2 */ ) : + ChartTypeTemplate( xContext ), + m_ePieOffsetMode( eMode ), + m_nDim( nDim ), + m_bIsRingChart( bRings ) +{} + +PieChartTypeTemplate::~PieChartTypeTemplate() +{} + +sal_Int32 PieChartTypeTemplate::getDimension() const +{ + return m_nDim; +} + +uno::Reference< chart2::XBoundedCoordinateSystem > PieChartTypeTemplate::createCoordinateSystem( + const uno::Reference< chart2::XBoundedCoordinateSystemContainer > & xCoordSysCnt ) +{ + uno::Reference< chart2::XCoordinateSystem > xCoordSys( + new PolarCoordinateSystem( getDimension() )); + uno::Reference< chart2::XBoundedCoordinateSystem > xResult( + new BoundedCoordinateSystem( xCoordSys )); + + chart2::ScaleData aScale; + aScale.Orientation = chart2::AxisOrientation_MATHEMATICAL; + aScale.Scaling = new LinearScaling( 1.0, 0.0 ); + + for( sal_Int32 i = 0; i < getDimension(); ++i ) + xResult->setScaleByDimension( + i, uno::Reference< chart2::XScale >( new Scale( GetComponentContext(), aScale ) )); + + try + { + if( xCoordSys.is()) + xCoordSysCnt->addCoordinateSystem( xResult ); + } + catch( lang::IllegalArgumentException ex ) + { + ASSERT_EXCEPTION( ex ); + } + + return xResult; +} + +void PieChartTypeTemplate::createAndAddAxes( + const uno::Reference< chart2::XBoundedCoordinateSystem > & rCoordSys, + const uno::Reference< chart2::XAxisContainer > & rOutAxisCnt ) +{ + // do nothing -- there are no axes in a pie chart +} + +Reference< chart2::XDataSeriesTreeParent > PieChartTypeTemplate::createDataSeriesTree( + const Sequence< Reference< chart2::XDataSeries > > & aSeriesSeq, + const Reference< chart2::XBoundedCoordinateSystem > & rCoordSys ) +{ + sal_Int32 nOffset = (m_ePieOffsetMode == NO_OFFSET) + ? 0 + : m_nDefaultOffset; + + // create series tree nodes + // root + Reference< chart2::XDataSeriesTreeParent > aRoot( createRootNode()); + + // chart type group + Reference< chart2::XDataSeriesTreeNode > aChartTypeNode( + createChartTypeGroup( new PieChartType( m_nDim, nOffset ))); + + // 'x-axis' group + Reference< chart2::XDataSeriesTreeNode > aCategoryNode( + createScaleGroup( true, true, rCoordSys, 0, chart2::StackMode_STACKED )); + + // 'y-axis' group + Reference< chart2::XDataSeriesTreeNode > aValueNode( + createScaleGroup( false, true, rCoordSys, 1, getStackMode() )); + + // add chart type node to root of tree + aRoot->addChild( aChartTypeNode ); + + // build tree + // add series node to value node + if( m_ePieOffsetMode == FIRST_EXPLODED ) + { + if( aSeriesSeq.getLength() >= 1 ) + { + Sequence< Reference< chart2::XDataSeries > > aFirst( aSeriesSeq.getConstArray(), 1 ); + addDataSeriesToGroup( aValueNode, aFirst ); + } + + if( aSeriesSeq.getLength() > 1 ) + { + // chart type group + Reference< chart2::XDataSeriesTreeNode > aChartTypeNode2( + createChartTypeGroup( new PieChartType( m_nDim, 0 ))); + + // 'x-axis' group + Reference< chart2::XDataSeriesTreeNode > aCategoryNode2( + createScaleGroup( true, true, rCoordSys, 0, chart2::StackMode_STACKED )); + + // 'y-axis' group + Reference< chart2::XDataSeriesTreeNode > aValueNode2( + createScaleGroup( false, true, rCoordSys, 1, getStackMode() )); + + Sequence< Reference< chart2::XDataSeries > > aRest( aSeriesSeq.getConstArray() + 1, + aSeriesSeq.getLength() - 1 ); + addDataSeriesToGroup( aValueNode2, aRest ); + + attachNodeToNode( aCategoryNode2, aValueNode2 ); + attachNodeToNode( aChartTypeNode2, aCategoryNode2 ); + + aRoot->addChild( aChartTypeNode2 ); + } + } + else + addDataSeriesToGroup( aValueNode, aSeriesSeq ); + + // add value node to category node + attachNodeToNode( aCategoryNode, aValueNode ); + + // add category node to chart type node + attachNodeToNode( aChartTypeNode, aCategoryNode ); + + return aRoot; +} + +// ____ XChartTypeTemplate ____ +uno::Reference< chart2::XChartType > SAL_CALL PieChartTypeTemplate::getChartTypeForAdditionalSeries() + throw (uno::RuntimeException) +{ + sal_Int32 nOffset = 0; + if( m_ePieOffsetMode == ALL_EXPLODED ) + nOffset = m_nDefaultOffset; + + return new PieChartType( m_nDim, nOffset ); +} + +} // namespace chart diff --git a/chart2/source/model/template/PieChartTypeTemplate.hxx b/chart2/source/model/template/PieChartTypeTemplate.hxx new file mode 100644 index 000000000000..8d2bbdd24904 --- /dev/null +++ b/chart2/source/model/template/PieChartTypeTemplate.hxx @@ -0,0 +1,129 @@ +/************************************************************************* + * + * $RCSfile: PieChartTypeTemplate.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_PIECHARTTYPETEMPLATE_HXX +#define CHART_PIECHARTTYPETEMPLATE_HXX + +#include "ChartTypeTemplate.hxx" + +namespace chart +{ + +class PieChartTypeTemplate : public ChartTypeTemplate +{ +public: + enum PieOffsetMode + { + NO_OFFSET, + FIRST_EXPLODED, + ALL_EXPLODED + }; + + PieChartTypeTemplate( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext, + PieOffsetMode eMode, + bool bRings = false, + sal_Int32 nDim = 2 ); + virtual ~PieChartTypeTemplate(); + +protected: + // ____ ChartTypeTemplate ____ + virtual sal_Int32 getDimension() const; + + virtual void createAndAddAxes( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > & rCoordSys, + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XAxisContainer > & rOutAxisCnt ); + + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > + createCoordinateSystem( + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystemContainer > & xCoordSysCnt ); + + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeriesTreeParent > createDataSeriesTree( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeries > >& aSeriesSeq, + const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > & rCoordSys + ); + + // ____ XChartTypeTemplate ____ + virtual ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XChartType > SAL_CALL getChartTypeForAdditionalSeries() + throw (::com::sun::star::uno::RuntimeException); + +private: + PieOffsetMode m_ePieOffsetMode; + sal_Int32 m_nDim; + bool m_bIsRingChart; + + // same value as in old chart + static const sal_Int32 m_nDefaultOffset = 10; +}; + +} // namespace chart + +// CHART_PIECHARTTYPETEMPLATE_HXX +#endif diff --git a/chart2/source/model/template/makefile.mk b/chart2/source/model/template/makefile.mk new file mode 100644 index 000000000000..a24cb6d3eed0 --- /dev/null +++ b/chart2/source/model/template/makefile.mk @@ -0,0 +1,95 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ= ..$/..$/.. +PRJNAME= chart2 +TARGET= chmodeltemplate + +PRJINC= $(PRJ)$/source + +ENABLE_EXCEPTIONS= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: settings.mk + +# --- export library ------------------------------------------------- + +#Specifies object files to bind into linked libraries. +SLOFILES= \ + $(SLO)$/AreaChartType.obj \ + $(SLO)$/AreaChartTypeTemplate.obj \ + $(SLO)$/BarChartType.obj \ + $(SLO)$/BarChartTypeTemplate.obj \ + $(SLO)$/ChartType.obj \ + $(SLO)$/ChartTypeManager.obj \ + $(SLO)$/ChartTypeTemplate.obj \ + $(SLO)$/ColumnLineChartTypeTemplate.obj \ + $(SLO)$/DoubleStackedBarChartTypeTemplate.obj \ + $(SLO)$/LineChartType.obj \ + $(SLO)$/LineChartTypeTemplate.obj \ + $(SLO)$/PieChartType.obj \ + $(SLO)$/PieChartTypeTemplate.obj + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk diff --git a/chart2/source/tools/ChartModelHelper.cxx b/chart2/source/tools/ChartModelHelper.cxx new file mode 100644 index 000000000000..50e560395c51 --- /dev/null +++ b/chart2/source/tools/ChartModelHelper.cxx @@ -0,0 +1,213 @@ +/************************************************************************* + * + * $RCSfile: ChartModelHelper.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ChartModelHelper.hxx" +#include "macros.hxx" + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTDOCUMENT_HPP_ +#include <drafts/com/sun/star/chart2/XChartDocument.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTTYPEGROUP_HPP_ +#include <drafts/com/sun/star/chart2/XChartTypeGroup.hpp> +#endif + +// header for define DBG_ASSERT +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +//static +uno::Reference< XDiagram > ChartModelHelper::findDiagram( const uno::Reference< frame::XModel >& xModel ) +{ + uno::Reference< XChartDocument > xChartDoc( xModel, uno::UNO_QUERY ); + if( xChartDoc.is()) + return xChartDoc->getDiagram(); + return NULL; +} + +//static +sal_Int32 ChartModelHelper::getDimensionAndFirstChartType( const uno::Reference< XDiagram >& xDiagram, rtl::OUString& rChartType ) +{ + sal_Int32 nDimension = 2; + + //@todo maybe get the dimension better from diagram properties ... -> need model change + if(!xDiagram.is()) + return nDimension; + uno::Reference< XDataSeriesTreeParent > xTree = xDiagram->getTree(); + if(!xTree.is()) + return nDimension; + uno::Sequence< uno::Reference< XDataSeriesTreeNode > > aChartTypes( xTree->getChildren() ); + for( sal_Int32 i = 0; i < aChartTypes.getLength(); ++i ) + { + uno::Reference< XChartTypeGroup > xChartTypeGroup( aChartTypes[i], uno::UNO_QUERY ); + DBG_ASSERT(xChartTypeGroup.is(),"First node at the diagram tree needs to be a ChartTypeGroup"); + if( !xChartTypeGroup.is() ) + continue; + uno::Reference< XChartType > xChartType = xChartTypeGroup->getChartType(); + if( !xChartType.is() ) + continue; + uno::Reference< beans::XPropertySet > xChartTypeProp( xChartType, uno::UNO_QUERY ); + if( xChartTypeProp.is()) + { + try + { + if( (xChartTypeProp->getPropertyValue( C2U( "Dimension" )) >>= nDimension) ) + { + rChartType = xChartType->getChartType(); + return nDimension; + } + else + { + DBG_ERROR( "Couldn't get Dimension from ChartTypeGroup" ); + } + } + catch( beans::UnknownPropertyException ex ) + { + ASSERT_EXCEPTION( ex ); + } + break; + } + } + return nDimension; +} + +namespace +{ +void lcl_addSeries( uno::Reference< XDataSeriesTreeParent > xParent, + ::std::vector< uno::Reference< XDataSeries > > & rOutSeriesVec ) +{ + if( xParent.is()) + { + uno::Sequence< uno::Reference< XDataSeriesTreeNode > > aChildren( xParent->getChildren()); + for( sal_Int32 i = 0; i < aChildren.getLength(); ++i ) + { + uno::Reference< XDataSeries > aDataSeries( aChildren[ i ], uno::UNO_QUERY ); + if( aDataSeries.is()) + { + rOutSeriesVec.push_back( aDataSeries ); + } + else + { + uno::Reference< XDataSeriesTreeParent > xNewParent( aChildren[ i ], uno::UNO_QUERY ); + if( xNewParent.is()) + lcl_addSeries( xNewParent, rOutSeriesVec ); + } + } + } +} +} // anonymous namespace + +// static +::std::vector< uno::Reference< XDataSeries > > ChartModelHelper::getDataSeries( + const uno::Reference< frame::XModel > & xModel ) +{ + ::std::vector< uno::Reference< XDataSeries > > aResult; + uno::Reference< XChartDocument > xDocument( xModel, uno::UNO_QUERY ); + if( xDocument.is()) + { + uno::Reference< XDiagram > xDia( xDocument->getDiagram()); + if( xDia.is()) + lcl_addSeries( xDia->getTree(), aResult ); + } + + return aResult; +} + +//static +uno::Reference< XDataSeries > ChartModelHelper::getSeriesByIdentifier( + const rtl::OUString& rIdentifier + , const uno::Reference< frame::XModel > xModel ) +{ + if(!rIdentifier.getLength()) + return NULL; + + ::std::vector< uno::Reference< XDataSeries > > aSeriesList( + getDataSeries( xModel )); + uno::Reference< XDataSeries > xRet; + uno::Reference< beans::XPropertySet > xProp; + rtl::OUString aIdentifier; + + ::std::vector< uno::Reference< XDataSeries > >::const_iterator aIt; + for( aIt = aSeriesList.begin(); aIt != aSeriesList.end(); ++aIt ) + { + xProp = uno::Reference< beans::XPropertySet >( *aIt, uno::UNO_QUERY ); + if(!xProp.is()) + continue; + uno::Any aAIdentifier = xProp->getPropertyValue( C2U( "Identifier" ) ); + aAIdentifier >>= aIdentifier; + if(aIdentifier.getLength() && rIdentifier.match(aIdentifier)) + { + xRet = *aIt; + break; + } + } + return xRet; +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/tools/CommonConverters.cxx b/chart2/source/tools/CommonConverters.cxx new file mode 100644 index 000000000000..53df5d1f15cf --- /dev/null +++ b/chart2/source/tools/CommonConverters.cxx @@ -0,0 +1,640 @@ +/************************************************************************* + * + * $RCSfile: CommonConverters.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef __CHART_COMMON_CONVERTERS_HXX +#include "CommonConverters.hxx" +#endif + +#ifndef _COM_SUN_STAR_DRAWING_DOUBLESEQUENCE_HPP_ +#include <com/sun/star/drawing/DoubleSequence.hpp> +#endif +#ifndef _COM_SUN_STAR_TEXT_WRITINGMODE2_HPP_ +#include <com/sun/star/text/WritingMode2.hpp> +#endif + +#include <cstdarg> + + +//............................................................................. +namespace chart +{ +//............................................................................. + +using namespace ::com::sun::star; + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// diverse methods for class conversions; e.g. Matrix4D to HomogenMatrix +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +drawing::HomogenMatrix Matrix4DToHomogenMatrix( const Matrix4D& rM4 ) +{ + drawing::HomogenMatrix aHM; + aHM.Line1.Column1 = rM4[0][0]; + aHM.Line1.Column2 = rM4[0][1]; + aHM.Line1.Column3 = rM4[0][2]; + aHM.Line1.Column4 = rM4[0][3]; + aHM.Line2.Column1 = rM4[1][0]; + aHM.Line2.Column2 = rM4[1][1]; + aHM.Line2.Column3 = rM4[1][2]; + aHM.Line2.Column4 = rM4[1][3]; + aHM.Line3.Column1 = rM4[2][0]; + aHM.Line3.Column2 = rM4[2][1]; + aHM.Line3.Column3 = rM4[2][2]; + aHM.Line3.Column4 = rM4[2][3]; + aHM.Line4.Column1 = rM4[3][0]; + aHM.Line4.Column2 = rM4[3][1]; + aHM.Line4.Column3 = rM4[3][2]; + aHM.Line4.Column4 = rM4[3][3]; + return aHM; +} + +Matrix4D HomogenMatrixToMatrix4D( + const drawing::HomogenMatrix& rHM ) +{ + Matrix4D aM4; + aM4[0][0] = rHM.Line1.Column1; + aM4[0][1] = rHM.Line1.Column2; + aM4[0][2] = rHM.Line1.Column3; + aM4[0][3] = rHM.Line1.Column4; + aM4[1][0] = rHM.Line2.Column1; + aM4[1][1] = rHM.Line2.Column2; + aM4[1][2] = rHM.Line2.Column3; + aM4[1][3] = rHM.Line2.Column4; + aM4[2][0] = rHM.Line3.Column1; + aM4[2][1] = rHM.Line3.Column2; + aM4[2][2] = rHM.Line3.Column3; + aM4[2][3] = rHM.Line3.Column4; + aM4[3][0] = rHM.Line4.Column1; + aM4[3][1] = rHM.Line4.Column2; + aM4[3][2] = rHM.Line4.Column3; + aM4[3][3] = rHM.Line4.Column4; + return aM4; +} + +Matrix3D IgnoreZ( const Matrix4D& rM4 ) +{ + Matrix3D aM3; + aM3[0][0] = rM4[0][0]; + aM3[0][1] = rM4[0][1]; + aM3[0][2] = rM4[0][3]; + aM3[1][0] = rM4[1][0]; + aM3[1][1] = rM4[1][1]; + aM3[1][2] = rM4[1][3]; + aM3[2][0] = rM4[3][0]; + aM3[2][1] = rM4[3][1]; + aM3[2][2] = rM4[3][3]; + return aM3; +} + + +drawing::HomogenMatrix3 Matrix3DToHomogenMatrix3( const Matrix3D& rM3 ) +{ + drawing::HomogenMatrix3 aHM; + aHM.Line1.Column1 = rM3[0][0]; + aHM.Line1.Column2 = rM3[0][1]; + aHM.Line1.Column3 = rM3[0][2]; + aHM.Line2.Column1 = rM3[1][0]; + aHM.Line2.Column2 = rM3[1][1]; + aHM.Line2.Column3 = rM3[1][2]; + aHM.Line3.Column1 = rM3[2][0]; + aHM.Line3.Column2 = rM3[2][1]; + aHM.Line3.Column3 = rM3[2][2]; + return aHM; +} + +Matrix3D HomogenMatrix3ToMatrix3D( const drawing::HomogenMatrix3& rHM ) +{ + Matrix3D aM3; + aM3[0][0] = rHM.Line1.Column1; + aM3[0][1] = rHM.Line1.Column2; + aM3[0][2] = rHM.Line1.Column3; + aM3[1][0] = rHM.Line2.Column1; + aM3[1][1] = rHM.Line2.Column2; + aM3[1][2] = rHM.Line2.Column3; + aM3[2][0] = rHM.Line3.Column1; + aM3[2][1] = rHM.Line3.Column2; + aM3[2][2] = rHM.Line3.Column3; + return aM3; +} + +Vector3D Position3DToVector3D( const drawing::Position3D& rPosition ) +{ + return Vector3D( + rPosition.PositionX + , rPosition.PositionY + , rPosition.PositionZ + ); +} + +drawing::Direction3D Vector3DToDirection3D( const Vector3D& rVector) +{ + return drawing::Direction3D( + rVector.X() + , rVector.Y() + , rVector.Z() + ); +} + +/* +drawing::PolyPolygonShape3D XPolygonToPolyPolygonShape3D( const XPolygon& rP ) +{ + USHORT nPointCount = rP.GetPointCount(); + + drawing::PolyPolygonShape3D aPP; + + aPP.SequenceX.realloc(1); + aPP.SequenceY.realloc(1); + aPP.SequenceZ.realloc(1); + + drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray(); + drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray(); + drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray(); + + pOuterSequenceX->realloc(nPointCount); + pOuterSequenceY->realloc(nPointCount); + pOuterSequenceZ->realloc(nPointCount); + + double* pInnerSequenceX = pOuterSequenceX->getArray(); + double* pInnerSequenceY = pOuterSequenceY->getArray(); + double* pInnerSequenceZ = pOuterSequenceZ->getArray(); + + for(sal_Int32 nN = 0; nN < nPointCount; nN++) + { + *pInnerSequenceX++ = (double)rP[nN].X(); + *pInnerSequenceY++ = (double)rP[nN].Y(); + *pInnerSequenceZ++ = 0.0; + } + return aPP; +} +*/ + +drawing::PolyPolygonShape3D MakeLine3D( + const drawing::Position3D & rStart, + const drawing::Position3D & rEnd ) +{ + drawing::PolyPolygonShape3D aPP; + + aPP.SequenceX.realloc(1); + aPP.SequenceY.realloc(1); + aPP.SequenceZ.realloc(1); + + drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray(); + drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray(); + drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray(); + + pOuterSequenceX->realloc(2); + pOuterSequenceY->realloc(2); + pOuterSequenceZ->realloc(2); + + double* pInnerSequenceX = pOuterSequenceX->getArray(); + double* pInnerSequenceY = pOuterSequenceY->getArray(); + double* pInnerSequenceZ = pOuterSequenceZ->getArray(); + + *pInnerSequenceX++ = rStart.PositionX; + *pInnerSequenceY++ = rStart.PositionY; + *pInnerSequenceZ++ = rStart.PositionZ; + + *pInnerSequenceX++ = rEnd.PositionX; + *pInnerSequenceY++ = rEnd.PositionY; + *pInnerSequenceZ++ = rEnd.PositionZ; + + return aPP; +} + +void AddPointToPoly( drawing::PolyPolygonShape3D& rPoly, const drawing::Position3D& rPos, sal_Int32 nPolygonIndex ) +{ + if(nPolygonIndex<0) + { + OSL_ENSURE( false, "The polygon index needs to be > 0"); + nPolygonIndex=0; + } + + //make sure that we have enough polygons + if(nPolygonIndex >= rPoly.SequenceX.getLength() ) + { + rPoly.SequenceX.realloc(nPolygonIndex+1); + rPoly.SequenceY.realloc(nPolygonIndex+1); + rPoly.SequenceZ.realloc(nPolygonIndex+1); + } + + drawing::DoubleSequence* pOuterSequenceX = &rPoly.SequenceX.getArray()[nPolygonIndex]; + drawing::DoubleSequence* pOuterSequenceY = &rPoly.SequenceY.getArray()[nPolygonIndex]; + drawing::DoubleSequence* pOuterSequenceZ = &rPoly.SequenceZ.getArray()[nPolygonIndex]; + + sal_Int32 nOldPointCount = pOuterSequenceX->getLength(); + + pOuterSequenceX->realloc(nOldPointCount+1); + pOuterSequenceY->realloc(nOldPointCount+1); + pOuterSequenceZ->realloc(nOldPointCount+1); + + double* pInnerSequenceX = pOuterSequenceX->getArray(); + double* pInnerSequenceY = pOuterSequenceY->getArray(); + double* pInnerSequenceZ = pOuterSequenceZ->getArray(); + + pInnerSequenceX[nOldPointCount] = rPos.PositionX; + pInnerSequenceY[nOldPointCount] = rPos.PositionY; + pInnerSequenceZ[nOldPointCount] = rPos.PositionZ; +} + +void appendPoly( drawing::PolyPolygonShape3D& rRet, const drawing::PolyPolygonShape3D& rAdd ) +{ + sal_Int32 nOuterCount = Max( rRet.SequenceX.getLength(), rAdd.SequenceX.getLength() ); + rRet.SequenceX.realloc(nOuterCount); + rRet.SequenceY.realloc(nOuterCount); + rRet.SequenceZ.realloc(nOuterCount); + + for( sal_Int32 nOuter=0;nOuter<nOuterCount;nOuter++ ) + { + sal_Int32 nOldPointCount = rRet.SequenceX[nOuter].getLength(); + sal_Int32 nAddPointCount = 0; + if(nOuter<rAdd.SequenceX.getLength()) + nAddPointCount = rAdd.SequenceX[nOuter].getLength(); + if(!nAddPointCount) + continue; + + sal_Int32 nNewPointCount = nOldPointCount + nAddPointCount; + + rRet.SequenceX[nOuter].realloc(nNewPointCount); + rRet.SequenceY[nOuter].realloc(nNewPointCount); + rRet.SequenceZ[nOuter].realloc(nNewPointCount); + + sal_Int32 nPointTarget=nOldPointCount; + sal_Int32 nPointSource=nAddPointCount; + for( ; nPointSource-- ; nPointTarget++ ) + { + rRet.SequenceX[nOuter][nPointTarget] = rAdd.SequenceX[nOuter][nPointSource]; + rRet.SequenceY[nOuter][nPointTarget] = rAdd.SequenceY[nOuter][nPointSource]; + rRet.SequenceZ[nOuter][nPointTarget] = rAdd.SequenceZ[nOuter][nPointSource]; + } + } +} + +/* +drawing::PolyPolygonShape3D operator+( + const drawing::PolyPolygonShape3D& rPoly1 + , const drawing::PolyPolygonShape3D& rPoly2 ) +{ + drawing::PolyPolygonShape3D aRet; + + sal_Int32 nOuterCount = Max( rPoly1.SequenceX.getLength(), rPoly2.SequenceX.getLength() ); + aRet.SequenceX.realloc(nOuterCount); + aRet.SequenceY.realloc(nOuterCount); + aRet.SequenceZ.realloc(nOuterCount); + + for( sal_Int32 nOuter=0;nOuter<nOuterCount;nOuter++ ) + { + sal_Int32 nPointCount_1 = 0; + sal_Int32 nPointCount_2 = 0; + if(nOuter<rPoly1.SequenceX.getLength()) + nPointCount_1 = rPoly1.SequenceX[nOuter].getLength(); + if(nOuter<rPoly2.SequenceX.getLength()) + nPointCount_2 = rPoly2.SequenceX[nOuter].getLength(); + + sal_Int32 nPointCount = nPointCount_1 + nPointCount_2; + + aRet.SequenceX[nOuter].realloc(nPointCount); + aRet.SequenceY[nOuter].realloc(nPointCount); + aRet.SequenceZ[nOuter].realloc(nPointCount); + + sal_Int32 nPointTarget=0; + + { + sal_Int32 nPointSourceCount = nPointCount_1; + const drawing::PolyPolygonShape3D* pPoly = &rPoly1; + for( sal_Int32 nPointSource=0; nPointSource<nPointSourceCount ; nPointSource++,nPointTarget++ ) + { + aRet.SequenceX[nOuter][nPointTarget] = pPoly->SequenceX[nOuter][nPointSource]; + aRet.SequenceY[nOuter][nPointTarget] = pPoly->SequenceY[nOuter][nPointSource]; + aRet.SequenceZ[nOuter][nPointTarget] = pPoly->SequenceZ[nOuter][nPointSource]; + } + } + { + sal_Int32 nPointSourceCount = nPointCount_2; + const drawing::PolyPolygonShape3D* pPoly = &rPoly2; + for( sal_Int32 nPointSource=nPointSourceCount; nPointSource-- ; nPointTarget++ ) + { + aRet.SequenceX[nOuter][nPointTarget] = pPoly->SequenceX[nOuter][nPointSource]; + aRet.SequenceY[nOuter][nPointTarget] = pPoly->SequenceY[nOuter][nPointSource]; + aRet.SequenceZ[nOuter][nPointTarget] = pPoly->SequenceZ[nOuter][nPointSource]; + } + } + } + return aRet; +} +*/ +/* +drawing::PolyPolygonShape3D operator+( + const drawing::PolyPolygonShape3D& rPoly1 + , const drawing::PolyPolygonShape3D& rPoly2 ) +{ + drawing::PolyPolygonShape3D aRet; + + sal_Int32 nOuterCount = rPoly1.SequenceX.getLength()+rPoly2.SequenceX.getLength(); + aRet.SequenceX.realloc(nOuterCount); + aRet.SequenceY.realloc(nOuterCount); + aRet.SequenceZ.realloc(nOuterCount); + + drawing::DoubleSequence* pOuterSequenceX = aRet.SequenceX.getArray(); + drawing::DoubleSequence* pOuterSequenceY = aRet.SequenceY.getArray(); + drawing::DoubleSequence* pOuterSequenceZ = aRet.SequenceZ.getArray(); + + for( sal_Int32 nOuterTarget=0;nOuterTarget<nOuterCount;nOuterTarget++ ) + { + const drawing::PolyPolygonShape3D* pPoly = &rPoly1; + sal_Int32 nOuterSource = nOuterTarget; + if(nOuterTarget>=rPoly1.SequenceX.getLength()) + { + pPoly = &rPoly2; + nOuterSource -= rPoly1.SequenceX.getLength(); + } + + sal_Int32 nPointCount = pPoly->SequenceX[nOuterSource].getLength(); + + pOuterSequenceX->realloc(nPointCount); + pOuterSequenceY->realloc(nPointCount); + pOuterSequenceZ->realloc(nPointCount); + + double* pInnerSequenceX = pOuterSequenceX->getArray(); + double* pInnerSequenceY = pOuterSequenceY->getArray(); + double* pInnerSequenceZ = pOuterSequenceZ->getArray(); + + for( sal_Int32 nPoint=0;nPoint<nPointCount;nPoint++ ) + { + *pInnerSequenceX = pPoly->SequenceX[nOuterSource][nPoint]; + *pInnerSequenceY = pPoly->SequenceY[nOuterSource][nPoint]; + *pInnerSequenceZ = pPoly->SequenceZ[nOuterSource][nPoint]; + + pInnerSequenceX++; pInnerSequenceY++; pInnerSequenceZ++; + } + + pOuterSequenceX++; pOuterSequenceY++; pOuterSequenceZ++; + } + return aRet; +} +*/ + +drawing::PointSequenceSequence PolyToPointSequence( + const drawing::PolyPolygonShape3D& rPolyPolygon ) +{ + drawing::PointSequenceSequence aRet; + aRet.realloc( rPolyPolygon.SequenceX.getLength() ); + + for(sal_Int32 nN = 0; nN < rPolyPolygon.SequenceX.getLength(); nN++) + { + sal_Int32 nInnerLength = rPolyPolygon.SequenceX[nN].getLength(); + aRet[nN].realloc( nInnerLength ); + for( sal_Int32 nM = 0; nM < nInnerLength; nM++) + { + aRet[nN][nM].X = static_cast<sal_Int32>(rPolyPolygon.SequenceX[nN][nM]); + aRet[nN][nM].Y = static_cast<sal_Int32>(rPolyPolygon.SequenceY[nN][nM]); + } + } + return aRet; +} + +Polygon PolyToToolsPoly( const drawing::PolyPolygonShape3D& rPolyPolygon ) +{ + sal_Int32 nOuterLength = rPolyPolygon.SequenceX.getLength(); + if(!nOuterLength) + return Polygon(); + + sal_Int32 nNewSize = nOuterLength; + sal_Int32 nNewIndex = 0; + Polygon aRet(static_cast<USHORT>(nNewSize)); + + for(sal_Int32 nN = 0; nN < nOuterLength; nN++) + { + sal_Int32 nInnerLength = rPolyPolygon.SequenceX[nN].getLength(); + nNewSize += nInnerLength-1, + aRet.SetSize(static_cast<USHORT>(nNewSize)); + for( sal_Int32 nM = 0; nM < nInnerLength; nM++) + { + aRet.SetPoint( Point( static_cast<long>(rPolyPolygon.SequenceX[nN][nM]) + , static_cast<long>(rPolyPolygon.SequenceY[nN][nM]) + ) + , static_cast<USHORT>(nNewIndex) ); + nNewIndex++; + } + } + return aRet; +} + +drawing::PolyPolygonShape3D ToolsPolyToPoly( const Polygon& rToolsPoly, double zValue ) +{ + sal_Int32 nPointCount = rToolsPoly.GetSize(); + + drawing::PolyPolygonShape3D aPP; + + aPP.SequenceX.realloc(1); + aPP.SequenceY.realloc(1); + aPP.SequenceZ.realloc(1); + + drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray(); + drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray(); + drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray(); + + pOuterSequenceX->realloc(nPointCount); + pOuterSequenceY->realloc(nPointCount); + pOuterSequenceZ->realloc(nPointCount); + + double* pInnerSequenceX = pOuterSequenceX->getArray(); + double* pInnerSequenceY = pOuterSequenceY->getArray(); + double* pInnerSequenceZ = pOuterSequenceZ->getArray(); + + for( sal_Int32 nN = 0; nN<nPointCount; nN++ ) + { + const Point& rPos = rToolsPoly.GetPoint( static_cast<USHORT>(nN) ); + *pInnerSequenceX++ = rPos.X(); + *pInnerSequenceY++ = rPos.Y(); + *pInnerSequenceZ++ = zValue; + } + + return aPP; +} + +drawing::Position3D operator+( const drawing::Position3D& rPos + , const drawing::Direction3D& rDirection) +{ + return drawing::Position3D( + rPos.PositionX + rDirection.DirectionX + , rPos.PositionY + rDirection.DirectionY + , rPos.PositionZ + rDirection.DirectionZ + ); +} + +drawing::Position3D operator-( const drawing::Position3D& rPos + , const drawing::Direction3D& rDirection) +{ + return drawing::Position3D( + rPos.PositionX - rDirection.DirectionX + , rPos.PositionY - rDirection.DirectionY + , rPos.PositionZ - rDirection.DirectionZ + ); +} + +drawing::Direction3D operator-( const drawing::Position3D& rPos1 + , const drawing::Position3D& rPos2) +{ + return drawing::Direction3D( + rPos1.PositionX - rPos2.PositionX + , rPos1.PositionY - rPos2.PositionY + , rPos1.PositionZ - rPos2.PositionZ + ); +} + +drawing::Direction3D operator*( const drawing::Direction3D& rDirection + , double fFraction) +{ + return drawing::Direction3D( + fFraction*rDirection.DirectionX + , fFraction*rDirection.DirectionY + , fFraction*rDirection.DirectionZ + ); +} + +Vector3D SequenceToVector3D( const uno::Sequence< double >& rSeq ) +{ + OSL_ENSURE(rSeq.getLength()==3,"The sequence needs to have length 3 for conversion into vector"); + + double x=rSeq.getLength()>0?rSeq[0]:0.0; + double y=rSeq.getLength()>1?rSeq[1]:0.0; + double z=rSeq.getLength()>2?rSeq[2]:0.0; + + Vector3D aRet(x,y,z); + return aRet; +} + +uno::Sequence< double > Vector3DToSequence( const Vector3D& rVector ) +{ + uno::Sequence< double > aRet(3); + aRet[0] = rVector.X(); + aRet[1] = rVector.Y(); + aRet[2] = rVector.Z(); + return aRet; +} + +drawing::Position3D SequenceToPosition3D( const uno::Sequence< double >& rSeq ) +{ + OSL_ENSURE(rSeq.getLength()==3,"The sequence needs to have length 3 for conversion into vector"); + + drawing::Position3D aRet; + aRet.PositionX = rSeq.getLength()>0?rSeq[0]:0.0; + aRet.PositionY = rSeq.getLength()>1?rSeq[1]:0.0; + aRet.PositionZ = rSeq.getLength()>2?rSeq[2]:0.0; + return aRet; +} + +uno::Sequence< double > Position3DToSequence( const drawing::Position3D& rPosition ) +{ + uno::Sequence< double > aRet(3); + aRet[0] = rPosition.PositionX; + aRet[1] = rPosition.PositionY; + aRet[2] = rPosition.PositionZ; + return aRet; +} + +drawing::Direction3D SequenceToDirection3D( const uno::Sequence< double >& rSeq ) +{ + drawing::Direction3D aRet; + aRet.DirectionX = rSeq.getLength()>0?rSeq[0]:0.0; + aRet.DirectionY = rSeq.getLength()>1?rSeq[1]:0.0; + aRet.DirectionZ = rSeq.getLength()>2?rSeq[2]:0.0; + return aRet; +} + +uno::Sequence< double > Direction3DToSequence( const drawing::Direction3D& rDirection ) +{ + uno::Sequence< double > aRet(3); + aRet[0] = rDirection.DirectionX; + aRet[1] = rDirection.DirectionY; + aRet[2] = rDirection.DirectionZ; + return aRet; +} + +drawing::Direction3D operator/( const drawing::Direction3D& rDirection, double f ) +{ + OSL_ENSURE(f,"a Direction3D is divided by NULL"); + return drawing::Direction3D( + rDirection.DirectionX/f + , rDirection.DirectionY/f + , rDirection.DirectionZ/f + ); +} + +text::WritingMode WritingMode2ToWritingMode1( sal_Int16 nWritingMode2 ) +{ + switch(nWritingMode2) + { + case text::WritingMode2::RL_TB: + return text::WritingMode_RL_TB; + case text::WritingMode2::TB_RL: + return text::WritingMode_TB_RL; + case text::WritingMode2::LR_TB: + return text::WritingMode_LR_TB; + default: // TL + return text::WritingMode_TB_RL;//there can no correct conversion be done here + } +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/tools/ContextHelper.cxx b/chart2/source/tools/ContextHelper.cxx new file mode 100644 index 000000000000..abe516566935 --- /dev/null +++ b/chart2/source/tools/ContextHelper.cxx @@ -0,0 +1,92 @@ +/************************************************************************* + * + * $RCSfile: ContextHelper.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ContextHelper.hxx" +#include <cppuhelper/component_context.hxx> + +#include <vector> + +using namespace ::com::sun::star; + +namespace chart +{ + +namespace ContextHelper +{ + +uno::Reference< uno::XComponentContext > + createContext( + const tContextEntryMapType & rMap, + const uno::Reference< uno::XComponentContext > & rDelegateContext ) +{ + ::std::vector< ::cppu::ContextEntry_Init > aVec( rMap.size()); + for( tContextEntryMapType::const_iterator aIt = rMap.begin(); + aIt != rMap.end(); + ++aIt ) + { + aVec.push_back( ::cppu::ContextEntry_Init( (*aIt).first, (*aIt).second) ); + } + + return ::cppu::createComponentContext( & aVec[0], aVec.size(), rDelegateContext ); +} + +} // namespace ContextHelper + +} // namespace chart diff --git a/chart2/source/tools/ImplOPropertySet.cxx b/chart2/source/tools/ImplOPropertySet.cxx new file mode 100644 index 000000000000..517d115043ed --- /dev/null +++ b/chart2/source/tools/ImplOPropertySet.cxx @@ -0,0 +1,206 @@ +/************************************************************************* + * + * $RCSfile: ImplOPropertySet.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ImplOPropertySet.hxx" + +#include <algorithm> +#include <functional> + +#ifndef _COM_SUN_STAR_BEANS_XFASTPROPERTYSET_HPP_ +#include <com/sun/star/beans/XFastPropertySet.hpp> +#endif + +using namespace ::com::sun::star; + +namespace +{ + +struct lcl_getPropertyStateByHandle : + public ::std::unary_function< beans::PropertyState, sal_Int32 > +{ + lcl_getPropertyStateByHandle( + const ::property::impl::ImplOPropertySet::tPropertyMap & rMap ) + : m_rMap( rMap ) + {} + + inline beans::PropertyState operator() ( sal_Int32 nHandle ) + { + if( m_rMap.end() == m_rMap.find( nHandle )) + return beans::PropertyState_DEFAULT_VALUE; + return beans::PropertyState_DIRECT_VALUE; + } + +private: + const ::property::impl::ImplOPropertySet::tPropertyMap & m_rMap; +}; + +template< typename K, typename V > +struct lcl_eraseMapEntry : + public ::std::unary_function< void, K > +{ + lcl_eraseMapEntry( ::std::map< K, V > & rMap ) + : m_rMap( rMap ) + {} + + inline void operator() ( const K & aKey ) + { + m_rMap.erase( aKey ); + } + +private: + ::std::map< K, V > m_rMap; +}; + +} // anonymous namespace + +namespace property +{ +namespace impl +{ + +ImplOPropertySet::ImplOPropertySet() +{} + +beans::PropertyState ImplOPropertySet::GetPropertyStateByHandle( sal_Int32 nHandle ) const +{ + return lcl_getPropertyStateByHandle( m_aProperties ) ( nHandle ); +} + +uno::Sequence< beans::PropertyState > ImplOPropertySet::GetPropertyStatesByHandle( + const ::std::vector< sal_Int32 > & aHandles ) const +{ + uno::Sequence< beans::PropertyState > aResult( aHandles.size()); + + ::std::transform( aHandles.begin(), aHandles.end(), + aResult.getArray(), + lcl_getPropertyStateByHandle( m_aProperties )); + + return aResult; +} + +void ImplOPropertySet::SetPropertyToDefault( sal_Int32 nHandle ) +{ + tPropertyMap::iterator aFoundIter( m_aProperties.find( nHandle ) ); + + if( m_aProperties.end() != aFoundIter ) + { + m_aProperties.erase( aFoundIter ); + } +} + +void ImplOPropertySet::SetPropertiesToDefault( + const ::std::vector< sal_Int32 > & aHandles ) +{ + ::std::for_each( aHandles.begin(), aHandles.end(), + lcl_eraseMapEntry< sal_Int32, uno::Any >( m_aProperties ) ); +} + +void ImplOPropertySet::SetAllPropertiesToDefault() +{ + m_aProperties.clear(); +} + +bool ImplOPropertySet::GetPropertyValueByHandle( + uno::Any & rValue, + sal_Int32 nHandle ) const +{ + bool bResult = false; + + tPropertyMap::const_iterator aFoundIter( m_aProperties.find( nHandle ) ); + + if( m_aProperties.end() != aFoundIter ) + { + rValue = (*aFoundIter).second; + bResult = true; + } + + return bResult; +} + +void ImplOPropertySet::SetPropertyValueByHandle( + sal_Int32 nHandle, const uno::Any & rValue, uno::Any * pOldValue ) +{ + if( pOldValue != NULL ) + { + tPropertyMap::const_iterator aFoundIter( m_aProperties.find( nHandle ) ); + if( m_aProperties.end() != aFoundIter ) + (*pOldValue) = (*aFoundIter).second; + } + + m_aProperties[ nHandle ] = rValue; +} + +bool ImplOPropertySet::SetStyle( const uno::Reference< style::XStyle > & xStyle ) +{ + if( ! xStyle.is()) + return false; + + m_xStyle = xStyle; + return true; +} + +uno::Reference< style::XStyle > ImplOPropertySet::GetStyle() const +{ + return m_xStyle; +} + + +} // namespace impl +} // namespace chart diff --git a/chart2/source/tools/ImplOPropertySet.hxx b/chart2/source/tools/ImplOPropertySet.hxx new file mode 100644 index 000000000000..e598b4686e87 --- /dev/null +++ b/chart2/source/tools/ImplOPropertySet.hxx @@ -0,0 +1,133 @@ +/************************************************************************* + * + * $RCSfile: ImplOPropertySet.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef CHART_IMPLOPROPERTYSET_HXX +#define CHART_IMPLOPROPERTYSET_HXX + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATE_HPP_ +#include <com/sun/star/beans/PropertyState.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ +#include <com/sun/star/uno/Sequence.hxx> +#endif +#ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_ +#include <com/sun/star/style/XStyle.hpp> +#endif + +#include <map> +#include <vector> + +namespace property +{ +namespace impl +{ + +class ImplOPropertySet +{ +public: + ImplOPropertySet(); + + /** supports states DIRECT_VALUE and DEFAULT_VALUE + */ + ::com::sun::star::beans::PropertyState + GetPropertyStateByHandle( sal_Int32 nHandle ) const; + + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > + GetPropertyStatesByHandle( const ::std::vector< sal_Int32 > & aHandles ) const; + + void SetPropertyToDefault( sal_Int32 nHandle ); + void SetPropertiesToDefault( const ::std::vector< sal_Int32 > & aHandles ); + void SetAllPropertiesToDefault(); + + /** @param rValue is set to the value for the property given in nHandle. If + the property is not set, the style chain is searched for any + instance set there. If there was no value found either in the + property set itself or any of its styles, rValue remains + unchanged and false is returned. + + @return false if the property is default, true otherwise. + */ + bool GetPropertyValueByHandle( + ::com::sun::star::uno::Any & rValue, + sal_Int32 nHandle ) const; + + void SetPropertyValueByHandle( sal_Int32 nHandle, + const ::com::sun::star::uno::Any & rValue, + ::com::sun::star::uno::Any * pOldValue = NULL ); + + bool SetStyle( const ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle > & xStyle ); + ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle > + GetStyle() const; + + typedef + ::std::map< sal_Int32, ::com::sun::star::uno::Any > + tPropertyMap; + +private: + tPropertyMap m_aProperties; + ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle > + m_xStyle; +}; + +} // namespace impl +} // namespace chart + +// CHART_IMPLOPROPERTYSET_HXX +#endif diff --git a/chart2/source/tools/LegendHelper.cxx b/chart2/source/tools/LegendHelper.cxx new file mode 100644 index 000000000000..b3027f3d5083 --- /dev/null +++ b/chart2/source/tools/LegendHelper.cxx @@ -0,0 +1,78 @@ +/************************************************************************* + * + * $RCSfile: LegendHelper.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "LegendHelper.hxx" +#include "macros.hxx" + +//............................................................................. +namespace chart +{ +//............................................................................. + +rtl::OUString LegendHelper::getIdentifierForLegend() +{ + static rtl::OUString m_aIdentifier( C2U( "@legend" ) ); + return m_aIdentifier; +} + +//............................................................................. +} //namespace chart +//............................................................................. + diff --git a/chart2/source/tools/LifeTime.cxx b/chart2/source/tools/LifeTime.cxx new file mode 100644 index 000000000000..a134509e79b6 --- /dev/null +++ b/chart2/source/tools/LifeTime.cxx @@ -0,0 +1,572 @@ +/************************************************************************* + * + * $RCSfile: LifeTime.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "LifeTime.hxx" + +#ifndef _OSL_DIAGNOSE_H_ +#include <osl/diagnose.h> +#endif +/* +#ifndef _COM_SUN_STAR_LANG_XEVENTLISTENER_HPP_ +#include <com/sun/star/lang/XEventListener.hpp> +#endif +*/ + +using namespace ::com::sun::star; + +namespace apphelper +{ +//-------------------------- + +LifeTimeManager::LifeTimeManager( lang::XComponent* pComponent, sal_Bool bLongLastingCallsCancelable ) + : m_aListenerContainer( m_aAccessMutex ) + , m_pComponent(pComponent) + , m_bLongLastingCallsCancelable(bLongLastingCallsCancelable) +{ + impl_init(); +} + +void LifeTimeManager::impl_init() +{ + m_bDisposed = sal_False; + m_bInDispose = sal_False; + m_nAccessCount = 0; + m_nLongLastingCallCount = 0; + m_aNoAccessCountCondition.set(); + m_aNoLongLastingCallCountCondition.set(); +} + +LifeTimeManager::~LifeTimeManager() +{ +} + + sal_Bool LifeTimeManager +::impl_isDisposed() +{ + if( m_bDisposed || m_bInDispose ) + { + OSL_ENSURE( sal_False, "This component is already disposed " ); + return sal_True; + } + return sal_False; +} + sal_Bool LifeTimeManager +::impl_canStartApiCall() +{ + if( impl_isDisposed() ) + return sal_False; //behave passive if already disposed + + //mutex is acquired + return sal_True; +} + + void LifeTimeManager +::impl_registerApiCall(sal_Bool bLongLastingCall) +{ + //only allowed if not disposed + //do not acquire the mutex here because it will be acquired already + m_nAccessCount++; + if(m_nAccessCount==1) + //@todo? is it ok to wake some threads here while we have acquired the mutex? + m_aNoAccessCountCondition.reset(); + + if(bLongLastingCall) + m_nLongLastingCallCount++; + if(m_nLongLastingCallCount==1) + m_aNoLongLastingCallCountCondition.reset(); +} + void LifeTimeManager +::impl_unregisterApiCall(sal_Bool bLongLastingCall) +{ + //Mutex needs to be acquired exactly ones + //mutex may be released inbetween in special case of impl_apiCallCountReachedNull() + + OSL_ENSURE( m_nAccessCount>0, "access count mismatch" ); + m_nAccessCount--; + if(bLongLastingCall) + m_nLongLastingCallCount--; + if( m_nLongLastingCallCount==0 ) + { + m_aNoLongLastingCallCountCondition.set(); + } + if( m_nAccessCount== 0) + { + m_aNoAccessCountCondition.set(); + impl_apiCallCountReachedNull(); + + } +} + + sal_Bool LifeTimeManager +::dispose() throw(uno::RuntimeException) +{ + //hold no mutex + { + osl::Guard< osl::Mutex > aGuard( m_aAccessMutex ); + + if( m_bDisposed || m_bInDispose ) + { + OSL_ENSURE( sal_False, "This component is already disposed " ); + return sal_False; //behave passive if already disposed + } + + m_bInDispose = true; + //adding any listener is not allowed anymore + //new calls will not be accepted + //still running calls have the freedom to finish their work without crash + } + //no mutex is acquired + + //--do the disposing of listeners after calling this method + { + uno::Reference< lang::XComponent > xComponent = + uno::Reference< lang::XComponent >(m_pComponent);; + if(xComponent.is()) + { + ::cppu::OInterfaceContainerHelper* pIC = m_aListenerContainer.getContainer( + ::getCppuType((const uno::Reference< lang::XEventListener >*)0) ); + if( pIC ) + { + lang::EventObject aEvent( xComponent ); + pIC->disposeAndClear( aEvent ); + } + } + } + + //no mutex is acquired + { + osl::ClearableGuard< osl::Mutex > aGuard( m_aAccessMutex ); + OSL_ENSURE( !m_bDisposed, "dispose was called already" ); + m_bDisposed = sal_True; + aGuard.clear(); + } + //no mutex is acquired + + //wait until all still running calls have finished + //the accessCount cannot grow anymore, because all calls will return after checking m_bDisposed + m_aNoAccessCountCondition.wait(); + + //we are the only ones working on our data now + + return sal_True; + //--release all resources and references after calling this method successful +} + +//----------------------------------------------------------------- + +CloseableLifeTimeManager::CloseableLifeTimeManager( ::com::sun::star::util::XCloseable* pCloseable + , ::com::sun::star::lang::XComponent* pComponent + , sal_Bool bLongLastingCallsCancelable ) + : LifeTimeManager( pComponent, bLongLastingCallsCancelable ) + , m_pCloseable(pCloseable) +{ + impl_init(); +} + +CloseableLifeTimeManager::~CloseableLifeTimeManager() +{ +} + + sal_Bool CloseableLifeTimeManager +::impl_isDisposedOrClosed() +{ + if( impl_isDisposed() ) + return sal_True; + + if( m_bClosed ) + { + OSL_ENSURE( sal_False, "This object is already closed" ); + return sal_True; + } + return sal_False; +} + + sal_Bool CloseableLifeTimeManager +::g_close_startTryClose(sal_Bool bDeliverOwnership) + throw ( uno::Exception ) +{ + //no mutex is allowed to be acquired + { + osl::ResettableGuard< osl::Mutex > aGuard( m_aAccessMutex ); + + //Mutex needs to be acquired exactly ones; will be released inbetween + if( !impl_canStartApiCall() ) + return sal_False; + //mutex is acquired + + //not closed already -> we try to close again + m_bInTryClose = sal_True; + m_aEndTryClosingCondition.reset(); + + impl_registerApiCall(sal_False); + } + + //------------------------------------------------ + //no mutex is acquired + + //only remove listener calls will be worked on until end of tryclose + //all other new calls will wait till end of try close // @todo? is that really ok + + //?? still running calls have the freedom to finish their work without crash + + try + { + uno::Reference< util::XCloseable > xCloseable = + uno::Reference< util::XCloseable >(m_pCloseable);; + if(xCloseable.is()) + { + //--call queryClosing on all registered close listeners + ::cppu::OInterfaceContainerHelper* pIC = m_aListenerContainer.getContainer( + ::getCppuType((const uno::Reference< util::XCloseListener >*)0) );; + if( pIC ) + { + //lang::EventObject aEvent( static_cast< util::XCloseable*>(xCloseable) ); + lang::EventObject aEvent( xCloseable ); + ::cppu::OInterfaceIteratorHelper aIt( *pIC ); + while( aIt.hasMoreElements() ) + (static_cast< util::XCloseListener*>(aIt.next()))->queryClosing( aEvent, bDeliverOwnership ); + } + } + } + catch( uno::Exception& ex ) + { + //no mutex is acquired + g_close_endTryClose(bDeliverOwnership, sal_False, ex); + //the exception is thrown in the above method + } + return sal_True; +} + + void CloseableLifeTimeManager +::g_close_endTryClose(sal_Bool bDeliverOwnership, sal_Bool bMyVeto, uno::Exception& ex) + throw ( uno::Exception ) +{ + //this method is called, if the try to close was not successfull + osl::Guard< osl::Mutex > aGuard( m_aAccessMutex ); + impl_setOwnership( bDeliverOwnership, sal_False ); + + m_bInTryClose = sal_False; + m_aEndTryClosingCondition.set(); + + //Mutex needs to be acquired exactly ones + //mutex may be released inbetween in special case of impl_apiCallCountReachedNull() + impl_unregisterApiCall(sal_False); + + //this exception must be thrown to the caller + throw ex; +} + + sal_Bool CloseableLifeTimeManager +::g_close_isNeedToCancelLongLastingCalls( sal_Bool bDeliverOwnership, uno::Exception& ex ) + throw ( uno::Exception ) +{ + //this method is called when no closelistener has had a veto during queryclosing + //the method returns false, if nothing stands against closing anymore + //it returns true, if some longlasting calls are running, which might be cancelled + //it throws the given exception, if long calls are running but not cancelable + + osl::Guard< osl::Mutex > aGuard( m_aAccessMutex ); + //this count cannot grow after try of close has started, because we wait in all those methods for end of try closing + if( !m_nLongLastingCallCount ) + return sal_False; + + if(m_bLongLastingCallsCancelable) + return sal_True; + + impl_setOwnership( bDeliverOwnership, sal_True ); + + m_bInTryClose = sal_False; + m_aEndTryClosingCondition.set(); + + //Mutex needs to be acquired exactly ones + //mutex may be released inbetween in special case of impl_apiCallCountReachedNull() + impl_unregisterApiCall(sal_False); + + throw ex; +} + + void CloseableLifeTimeManager +::g_close_endTryClose_doClose() +{ + //this method is called, if the try to close was successfull + osl::ResettableGuard< osl::Mutex > aGuard( m_aAccessMutex ); + + m_bInTryClose = sal_False; + m_aEndTryClosingCondition.set(); + + //Mutex needs to be acquired exactly ones + //mutex may be released inbetween in special case of impl_apiCallCountReachedNull() + impl_unregisterApiCall(sal_False); + impl_doClose(); +} + + void CloseableLifeTimeManager +::impl_setOwnership( sal_Bool bDeliverOwnership, sal_Bool bMyVeto ) +{ + m_bOwnership = bDeliverOwnership && bMyVeto; + m_bOwnershipIsWellKnown = sal_True; +} + sal_Bool CloseableLifeTimeManager +::impl_shouldCloseAtNextChance() +{ + return m_bOwnership; +} + + void CloseableLifeTimeManager +::impl_apiCallCountReachedNull() +{ + //Mutex needs to be acquired exactly ones + //mutex will be released inbetween in impl_doClose() + if( m_pCloseable && impl_shouldCloseAtNextChance() ) + impl_doClose(); +} + + void CloseableLifeTimeManager +::impl_doClose() +{ + //Mutex needs to be acquired exactly ones before calling impl_doClose() + + if(m_bClosed) + return; //behave as passive as possible, if disposed or closed already + if( m_bDisposed || m_bInDispose ) + return; //behave as passive as possible, if disposed or closed already + + //-------- + m_bClosed = sal_True; + + NegativeGuard< osl::Mutex > aNegativeGuard( m_aAccessMutex ); + //mutex is not acquired, mutex will be reacquired at the end of this method automatically + + uno::Reference< util::XCloseable > xCloseable=NULL; + try + { + xCloseable = uno::Reference< util::XCloseable >(m_pCloseable);; + if(xCloseable.is()) + { + //--call notifyClosing on all registered close listeners + ::cppu::OInterfaceContainerHelper* pIC = m_aListenerContainer.getContainer( + ::getCppuType((const uno::Reference< util::XCloseListener >*)0) );; + if( pIC ) + { + //lang::EventObject aEvent( static_cast< util::XCloseable*>(xCloseable) ); + lang::EventObject aEvent( xCloseable ); + ::cppu::OInterfaceIteratorHelper aIt( *pIC ); + while( aIt.hasMoreElements() ) + (static_cast< util::XCloseListener*>(aIt.next()))->notifyClosing( aEvent ); + } + } + } + catch( uno::Exception& ex ) + { + OSL_ENSURE( sal_False, "Exception during notifyClosing of XCloseListener" ); + } + + if(xCloseable.is()) + { + uno::Reference< lang::XComponent > xComponent = + uno::Reference< lang::XComponent >( xCloseable, uno::UNO_QUERY ); + if(xComponent.is()) + { + OSL_ENSURE( m_bClosed, "a not closed component will be disposed " ); + xComponent->dispose(); + } + } + //mutex will be reacquired in destructor of aNegativeGuard +} + + sal_Bool CloseableLifeTimeManager +::g_addCloseListener( const uno::Reference< util::XCloseListener > & xListener ) + throw(uno::RuntimeException) +{ + osl::Guard< osl::Mutex > aGuard( m_aAccessMutex ); + //Mutex needs to be acquired exactly ones; will be released inbetween + if( !impl_canStartApiCall() ) + return sal_False; + //mutex is acquired + + m_aListenerContainer.addInterface( ::getCppuType((const uno::Reference< util::XCloseListener >*)0),xListener ); + m_bOwnership = sal_False; + return sal_True; +} + + sal_Bool CloseableLifeTimeManager +::impl_canStartApiCall() +{ + //Mutex needs to be acquired exactly ones before calling this method + //the mutex will be released inbetween and reacquired + + if( impl_isDisposed() ) + return sal_False; //behave passive if already disposed + if( m_bClosed ) + return sal_False; //behave passive if closing is already done + + //during try-close most calls need to wait for the decision + while( m_bInTryClose ) + { + //if someone tries to close this object at the moment + //we need to wait for his end because the result of the preceding call + //is relevant for our behaviour here + + m_aAccessMutex.release(); + m_aEndTryClosingCondition.wait(); //@todo??? this may block??? try closing + m_aAccessMutex.acquire(); + if( m_bDisposed || m_bInDispose || m_bClosed ) + return sal_False; //return if closed already + } + //mutex is acquired + return sal_True; +} + +//-------------------------- + + sal_Bool LifeTimeGuard +::startApiCall(sal_Bool bLongLastingCall) +{ + //Mutex needs to be acquired exactly ones; will be released inbetween + //mutex is requiered due to constructor of LifeTimeGuard + + OSL_ENSURE( !m_bCallRegistered, "this method is only allowed ones" ); + if(m_bCallRegistered) + return sal_False; + + //Mutex needs to be acquired exactly ones; will be released inbetween + if( !m_rManager.impl_canStartApiCall() ) + return sal_False; + //mutex is acquired + + m_bCallRegistered = sal_True; + m_bLongLastingCallRegistered = bLongLastingCall; + m_rManager.impl_registerApiCall(bLongLastingCall); + return sal_True; +} + +LifeTimeGuard::~LifeTimeGuard() +{ + try + { + //do acquire the mutex if it was cleared before + if(!pT) + reset(); + if(m_bCallRegistered) + { + //Mutex needs to be acquired exactly ones + //mutex may be released inbetween in special case of impl_apiCallCountReachedNull() + m_rManager.impl_unregisterApiCall(m_bLongLastingCallRegistered); + } + } + catch( uno::Exception& ex ) + { + //@todo ? allow a uno::RuntimeException from dispose to travel through?? + } +} + +/* +the XCloseable::close method has to be implemented in the following way: +::close +{ + //hold no mutex + + if( !m_aLifeTimeManager.g_close_startTryClose( bDeliverOwnership ) ) + return; + //no mutex is acquired + + // At the end of this method may we must dispose ourself ... + // and may nobody from outside hold a reference to us ... + // then it's a good idea to do that by ourself. + uno::Reference< uno::XInterface > xSelfHold( static_cast< ::cppu::OWeakObject* >(this) ); + + //the listeners have had no veto + //check wether we self can close + { + util::CloseVetoException aVetoException = util::CloseVetoException( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "the model itself could not be closed" ) ) + , static_cast< ::cppu::OWeakObject* >(this)); + + if( m_aLifeTimeManager.g_close_isNeedToCancelLongLastingCalls( bDeliverOwnership, aVetoException) ) + { + ////you can empty this block, if you never start longlasting calls or + ////if your longlasting calls are per default not cancelable (check how you have constructed your LifeTimeManager) + + sal_Bool bLongLastingCallsAreCanceled = sal_False; + try + { + //try to cancel running longlasting calls + //// @todo + } + catch( uno::Exception& ex ) + { + //// @todo + //do not throw anything here!! (without endTryClose) + } + //if not successful canceled + if(!bLongLastingCallsAreCanceled) + { + m_aLifeTimeManager.g_close_endTryClose(bDeliverOwnership, sal_True, aVetoException); + //the exception is thrown in the above method + } + } + + } + m_aLifeTimeManager.g_close_endTryClose_doClose(); +} +*/ + +}//end namespace apphelper diff --git a/chart2/source/tools/MediaDescriptorHelper.cxx b/chart2/source/tools/MediaDescriptorHelper.cxx new file mode 100644 index 000000000000..e37438a67247 --- /dev/null +++ b/chart2/source/tools/MediaDescriptorHelper.cxx @@ -0,0 +1,260 @@ +/************************************************************************* + * + * $RCSfile: MediaDescriptorHelper.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "MediaDescriptorHelper.hxx" + +using namespace ::com::sun::star; + +namespace apphelper +{ + + +const short FLAG_DEPRECATED =1; +const short FLAG_MODEL =2; + +#define WRITE_PROPERTY( MediaName, nFlags ) \ +if(rProp.Name.equals(::rtl::OUString::createFromAscii(#MediaName))) \ +{ \ + if( rProp.Value >>= MediaName ) \ + ISSET_##MediaName = sal_True; \ + if(nFlags & FLAG_DEPRECATED) \ + { \ + m_aDeprecatedProperties[nDeprecatedCount]=rProp;\ + nDeprecatedCount++; \ + } \ + else \ + { \ + m_aRegularProperties[nRegularCount]=rProp; \ + nRegularCount++; \ + if( nFlags & FLAG_MODEL) \ + { \ + m_aModelProperties[nModelCount]=rProp; \ + nModelCount++; \ + } \ + } \ +} + +MediaDescriptorHelper::MediaDescriptorHelper( const uno::Sequence< + beans::PropertyValue > & rMediaDescriptor ) +{ + impl_init(); + + m_aRegularProperties.realloc(0); + m_aRegularProperties.realloc(rMediaDescriptor.getLength()); + sal_Int32 nRegularCount = 0; + + m_aDeprecatedProperties.realloc(0); + m_aDeprecatedProperties.realloc(rMediaDescriptor.getLength()); + sal_Int32 nDeprecatedCount = 0; + + m_aAdditionalProperties.realloc(0); + m_aAdditionalProperties.realloc(rMediaDescriptor.getLength()); + sal_Int32 nAdditionalCount = 0; + + m_aModelProperties.realloc(0); + m_aModelProperties.realloc(rMediaDescriptor.getLength()); + sal_Int32 nModelCount = 0; + + + //read given rMediaDescriptor and store in internal structures: + for( sal_Int32 i= rMediaDescriptor.getLength();i--;) + { + const beans::PropertyValue& rProp = rMediaDescriptor[i]; + WRITE_PROPERTY( AsTemplate, FLAG_MODEL ) + else WRITE_PROPERTY( Author, FLAG_MODEL ) + else WRITE_PROPERTY( CharacterSet, FLAG_MODEL ) + else WRITE_PROPERTY( Comment, FLAG_MODEL ) + else WRITE_PROPERTY( ComponentData, FLAG_MODEL ) + else WRITE_PROPERTY( FileName, FLAG_DEPRECATED ) + else WRITE_PROPERTY( FilterData, FLAG_MODEL ) + else WRITE_PROPERTY( FilterName, FLAG_MODEL ) + else WRITE_PROPERTY( FilterFlags, FLAG_DEPRECATED) + else WRITE_PROPERTY( FilterOptions, FLAG_MODEL ) + else WRITE_PROPERTY( FrameName, FLAG_MODEL ) + else WRITE_PROPERTY( Hidden, FLAG_MODEL ) + else WRITE_PROPERTY( InputStream, 0 ) + else WRITE_PROPERTY( InteractionHandler, 0 ) + else WRITE_PROPERTY( JumpMark, 0 ) + else WRITE_PROPERTY( MediaType, FLAG_MODEL ) + else WRITE_PROPERTY( OpenFlags, FLAG_DEPRECATED ) + else WRITE_PROPERTY( OpenNewView, 0 ) + else WRITE_PROPERTY( Overwrite, FLAG_MODEL ) + else WRITE_PROPERTY( Password, FLAG_MODEL ) + else WRITE_PROPERTY( PosSize, 0 ) + else WRITE_PROPERTY( PostData, 0 ) + else WRITE_PROPERTY( PostString, FLAG_DEPRECATED ) + else WRITE_PROPERTY( Preview, FLAG_MODEL ) + else WRITE_PROPERTY( ReadOnly, 0 ) + else WRITE_PROPERTY( Referer, FLAG_MODEL ) + else WRITE_PROPERTY( Silent, 0 ) + else WRITE_PROPERTY( StatusIndicator, 0 ) + else WRITE_PROPERTY( TemplateName, FLAG_DEPRECATED ) + else WRITE_PROPERTY( TemplateRegionName, FLAG_DEPRECATED ) + else WRITE_PROPERTY( Unpacked, FLAG_MODEL ) + else WRITE_PROPERTY( URL, FLAG_MODEL ) + else WRITE_PROPERTY( Version, FLAG_MODEL ) + else WRITE_PROPERTY( ViewData, FLAG_MODEL ) + else WRITE_PROPERTY( ViewId, FLAG_MODEL ) + else + { + m_aAdditionalProperties[nAdditionalCount]=rProp; + nAdditionalCount++; + } + } + + m_aRegularProperties.realloc(nRegularCount); + m_aDeprecatedProperties.realloc(nDeprecatedCount); + m_aAdditionalProperties.realloc(nAdditionalCount); + m_aModelProperties.realloc(nModelCount); +} + +void MediaDescriptorHelper::impl_init() +{ + AsTemplate = sal_False; + ISSET_AsTemplate = sal_False; + + ISSET_Author = sal_False; + ISSET_CharacterSet = sal_False; + ISSET_Comment = sal_False; + +// ::com::sun::star::uno::Any ComponentData; + ISSET_ComponentData = sal_False; + ISSET_FileName = sal_False; + +// ::com::sun::star::uno::Any FilterData; + ISSET_FilterData = sal_False; + ISSET_FilterName = sal_False; + ISSET_FilterFlags = sal_False; + ISSET_FilterOptions = sal_False; + ISSET_FrameName = sal_False; + + Hidden = sal_False; + ISSET_Hidden = sal_False; + ISSET_InputStream = sal_False; + ISSET_InteractionHandler = sal_False; + ISSET_JumpMark = sal_False; + ISSET_MediaType = sal_False; + ISSET_OpenFlags = sal_False; + OpenNewView = sal_False; + ISSET_OpenNewView = sal_False; + Overwrite = sal_False; + ISSET_Overwrite = sal_False; + ISSET_Password = sal_False; + +// ::com::sun::star::awt::Rectangle PosSize; + ISSET_PosSize = sal_False; + +// ::com::sun::star::uno::Sequence< sal_Int8 > PostData; + ISSET_PostData = sal_False; + ISSET_PostString = sal_False; + Preview = sal_False; + ISSET_Preview = sal_False; + ReadOnly = sal_False; + ISSET_ReadOnly = sal_False; + ISSET_Referer = sal_False; + ISSET_StatusIndicator = sal_False; + Silent = sal_False; + ISSET_Silent = sal_False; + ISSET_TemplateName = sal_False; + ISSET_TemplateRegionName = sal_False; + Unpacked = sal_False; + ISSET_Unpacked = sal_False; + ISSET_URL = sal_False; + Version = 0; + ISSET_Version = sal_False; + +// ::com::sun::star::uno::Any ViewData; + ISSET_ViewData = sal_False; + ViewId = 0; + ISSET_ViewId = sal_False; +} + +MediaDescriptorHelper::~MediaDescriptorHelper() +{ + +} + + uno::Sequence< beans::PropertyValue > MediaDescriptorHelper +::getAll() +{ + uno::Sequence< beans::PropertyValue > aAll( m_aRegularProperties ); + //write properties to aAll + if( m_aDeprecatedProperties.getLength() ) + { + sal_Int32 nCount = m_aRegularProperties.getLength(); + m_aRegularProperties.realloc( nCount + m_aDeprecatedProperties.getLength()); + for(sal_Int32 i=0;i<m_aDeprecatedProperties.getLength();i++) + aAll[nCount+i]=m_aDeprecatedProperties[i]; + } + if( m_aAdditionalProperties.getLength() ) + { + sal_Int32 nCount = m_aRegularProperties.getLength(); + m_aRegularProperties.realloc(nCount + m_aAdditionalProperties.getLength()); + for(sal_Int32 i=0;i<m_aAdditionalProperties.getLength();i++) + aAll[nCount+i]=m_aAdditionalProperties[i]; + } + return aAll; +} + uno::Sequence< beans::PropertyValue > MediaDescriptorHelper +::getReducedForModel() +{ + return m_aModelProperties; +} +} diff --git a/chart2/source/tools/MutexContainer.cxx b/chart2/source/tools/MutexContainer.cxx new file mode 100644 index 000000000000..9a2f5c5fa570 --- /dev/null +++ b/chart2/source/tools/MutexContainer.cxx @@ -0,0 +1,77 @@ +/************************************************************************* + * + * $RCSfile: MutexContainer.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "MutexContainer.hxx" + +namespace chart +{ +namespace helper +{ + +MutexContainer::~MutexContainer() +{} + +::osl::Mutex & MutexContainer::GetMutex() const +{ + return m_aMutex; +} + +} // namespace helper +} // namespace chart diff --git a/chart2/source/tools/OEnumeration.cxx b/chart2/source/tools/OEnumeration.cxx new file mode 100644 index 000000000000..918b6a03e00d --- /dev/null +++ b/chart2/source/tools/OEnumeration.cxx @@ -0,0 +1,95 @@ +/************************************************************************* + * + * $RCSfile: OEnumeration.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "OEnumeration.hxx" + +using namespace ::com::sun::star; + +namespace comphelper +{ + +OEnumeration::OEnumeration( + const ::std::vector< uno::Any > & rContainer ) : + m_aContainer( rContainer ), + m_aIter( m_aContainer.begin() ) +{} + +OEnumeration::~OEnumeration() +{} + +sal_Bool SAL_CALL OEnumeration::hasMoreElements() + throw (uno::RuntimeException) +{ + return ! m_aContainer.empty(); +} + +uno::Any SAL_CALL OEnumeration::nextElement() + throw (container::NoSuchElementException, + lang::WrappedTargetException, + uno::RuntimeException) +{ + if( m_aIter == m_aContainer.end()) + throw container::NoSuchElementException(); + + return *m_aIter++; +} + + +} // namespace comphelper diff --git a/chart2/source/tools/OIndexContainer.cxx b/chart2/source/tools/OIndexContainer.cxx new file mode 100644 index 000000000000..80973b537e78 --- /dev/null +++ b/chart2/source/tools/OIndexContainer.cxx @@ -0,0 +1,214 @@ +/************************************************************************* + * + * $RCSfile: OIndexContainer.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "OIndexContainer.hxx" + +#ifndef _CPPUHELPER_QUERYINTERFACE_HXX_ +#include <cppuhelper/queryinterface.hxx> +#endif + +using namespace ::com::sun::star; +using ::osl::MutexGuard; + +namespace comphelper +{ + +OIndexContainer::OIndexContainer( ::osl::Mutex & rMutex ) : + m_rMutex( rMutex ) +{ +} + +OIndexContainer::~OIndexContainer() +{ +} + +::osl::Mutex & OIndexContainer::GetMutex() +{ + return m_rMutex; +} + +// ____ XInterface ____ +uno::Any SAL_CALL OIndexContainer::queryInterface( const uno::Type& aType ) + throw (uno::RuntimeException) +{ + return ::cppu::queryInterface( + aType, + static_cast< container::XIndexContainer * >( this ), + static_cast< container::XIndexReplace * >( this ), + static_cast< container::XIndexAccess * >( this ), + static_cast< container::XElementAccess * >( this ) ); +} + +// ____ XIndexContainer ____ +void SAL_CALL OIndexContainer::insertByIndex( sal_Int32 Index, const uno::Any& Element ) + throw (lang::IllegalArgumentException, + lang::IndexOutOfBoundsException, + lang::WrappedTargetException, + uno::RuntimeException) +{ + // valid range [0..size] + size_t nIndex( Index ); + + // /-- + MutexGuard aGuard( GetMutex()); + + if( nIndex < 0 || + nIndex > m_aContainer.size() ) + throw lang::IndexOutOfBoundsException(); + + if( getElementType().isAssignableFrom( Element.getValueType()) ) + throw lang::IllegalArgumentException(); + + if( nIndex == m_aContainer.size()) + m_aContainer.push_back( Element ); + else + { + m_aContainer.insert( m_aContainer.begin() + nIndex, Element ); + } + // \-- +} + +void SAL_CALL OIndexContainer::removeByIndex( sal_Int32 Index ) + throw (lang::IndexOutOfBoundsException, + lang::WrappedTargetException, + uno::RuntimeException) +{ + // valid range [0..size-1] + size_t nIndex( Index ); + + // /-- + MutexGuard aGuard( GetMutex()); + + if( nIndex < 0 || + nIndex > m_aContainer.size() ) + throw lang::IndexOutOfBoundsException(); + + m_aContainer.erase( m_aContainer.begin() + nIndex ); + // \-- +} + + +// ____ XIndexReplace ____ +void SAL_CALL OIndexContainer::replaceByIndex( sal_Int32 Index, const uno::Any& Element ) + throw (lang::IllegalArgumentException, + lang::IndexOutOfBoundsException, + lang::WrappedTargetException, + uno::RuntimeException) +{ + // valid range [0..size-1] + size_t nIndex( Index ); + + // /-- + MutexGuard aGuard( GetMutex()); + + if( nIndex < 0 || + nIndex > m_aContainer.size() ) + throw lang::IndexOutOfBoundsException(); + + if( getElementType().isAssignableFrom( Element.getValueType()) ) + throw lang::IllegalArgumentException(); + + m_aContainer[ nIndex ] = Element; + // \-- +} + + +// ____ XIndexAccess ____ +sal_Int32 SAL_CALL OIndexContainer::getCount() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex()); + + return m_aContainer.size(); + // \-- +} + +uno::Any SAL_CALL OIndexContainer::getByIndex( sal_Int32 Index ) + throw (lang::IndexOutOfBoundsException, + lang::WrappedTargetException, + uno::RuntimeException) +{ + // valid range [0..size-1] + size_t nIndex( Index ); + + // /-- + MutexGuard aGuard( GetMutex()); + + if( nIndex < 0 || + nIndex > m_aContainer.size() ) + throw lang::IndexOutOfBoundsException(); + + return m_aContainer.at( nIndex ); + // \-- +} + +sal_Bool SAL_CALL OIndexContainer::hasElements() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex()); + + return ! m_aContainer.empty(); + // \-- +} + + +} // namespace comphelper diff --git a/chart2/source/tools/OPropertySet.cxx b/chart2/source/tools/OPropertySet.cxx new file mode 100644 index 000000000000..6501d9637dfc --- /dev/null +++ b/chart2/source/tools/OPropertySet.cxx @@ -0,0 +1,463 @@ +/************************************************************************* + * + * $RCSfile: OPropertySet.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "OPropertySet.hxx" +#include "ImplOPropertySet.hxx" +#include "algohelper.hxx" + +#ifndef _RTL_UUID_H_ +#include <rtl/uuid.h> +#endif +#ifndef _CPPUHELPER_QUERYINTERFACE_HXX_ +#include <cppuhelper/queryinterface.hxx> +#endif + +#include <vector> +#include <algorithm> + +using namespace ::com::sun::star; + +using ::drafts::com::sun::star::style::XStyleSupplier; +// using ::drafts::com::sun::star::beans::XFastPropertyState; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Any; +using ::rtl::OUString; +using ::osl::MutexGuard; + +// needed for MS compiler +using ::cppu::OBroadcastHelper; +using ::cppu::OPropertySetHelper; +using ::cppu::OWeakObject; + +namespace property +{ + +OPropertySet::OPropertySet( ::osl::Mutex & _rMutex ) : + OBroadcastHelper( _rMutex ), + // the following causes a warning; there seems to be no way to avoid it + OPropertySetHelper( static_cast< OBroadcastHelper & >( *this )), + m_rMutex( _rMutex ), + m_pImplProperties( new impl::ImplOPropertySet() ) +{ +} + +OPropertySet::~OPropertySet() +{} + +Any SAL_CALL OPropertySet::queryInterface( const uno::Type& aType ) + throw (uno::RuntimeException) +{ + return ::cppu::queryInterface( + aType, +// static_cast< uno::XInterface * >( +// static_cast< uno::XWeak * >( this )), +// static_cast< uno::XWeak * >( this ), +// static_cast< lang::XServiceInfo * >( this ), + static_cast< lang::XTypeProvider * >( this ), + static_cast< beans::XPropertySet * >( this ), + static_cast< beans::XMultiPropertySet * >( this ), + static_cast< beans::XFastPropertySet * >( this ), + static_cast< beans::XPropertyState * >( this ), + static_cast< beans::XMultiPropertyStates * >( this ), + static_cast< XStyleSupplier * >( this ) ); +// static_cast< XFastPropertyState * >( this ) ); +} + +// void SAL_CALL OPropertySet::acquire() throw () +// { +// OWeakObject::acquire(); +// } + +// void SAL_CALL OPropertySet::release() throw () +// { +// OWeakObject::release(); +// } + + +// ____ XServiceInfo ____ +// OUString SAL_CALL +// OPropertySet::getImplementationName() +// throw (uno::RuntimeException) +// { +// return OUString( RTL_CONSTASCII_USTRINGPARAM( "property::OPropertySet" )); +// } + +// sal_Bool SAL_CALL +// OPropertySet::supportsService( const OUString& ServiceName ) +// throw (uno::RuntimeException) +// { +// return ( 0 == ServiceName.reverseCompareToAsciiL( +// RTL_CONSTASCII_STRINGPARAM( "com.sun.star.beans.PropertySet" ))); +// } + +// Sequence< OUString > SAL_CALL +// OPropertySet::getSupportedServiceNames() +// throw (uno::RuntimeException) +// { +// Sequence< OUString > aServiceNames( 1 ); +// aServiceNames[ 0 ] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.PropertySet" )); +// return aServiceNames; +// } + +#define LCL_PROP_CPPUTYPE(t) (::getCppuType( reinterpret_cast< const Reference<t> *>(0))) + +// // ____ XTypeProvider ____ +Sequence< uno::Type > SAL_CALL + OPropertySet::getTypes() + throw (uno::RuntimeException) +{ + static Sequence< uno::Type > aTypeList; + + // /-- + MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + + if( aTypeList.getLength() == 0 ) + { + ::std::vector< uno::Type > aTypes; + +// aTypes.push_back( LCL_PROP_CPPUTYPE( uno::XWeak )); +// aTypes.push_back( LCL_PROP_CPPUTYPE( lang::XServiceInfo )); + aTypes.push_back( LCL_PROP_CPPUTYPE( lang::XTypeProvider )); + aTypes.push_back( LCL_PROP_CPPUTYPE( beans::XPropertySet )); + aTypes.push_back( LCL_PROP_CPPUTYPE( beans::XMultiPropertySet )); + aTypes.push_back( LCL_PROP_CPPUTYPE( beans::XFastPropertySet )); + aTypes.push_back( LCL_PROP_CPPUTYPE( beans::XPropertyState )); + aTypes.push_back( LCL_PROP_CPPUTYPE( beans::XMultiPropertyStates )); + aTypes.push_back( LCL_PROP_CPPUTYPE( XStyleSupplier )); +// aTypes.push_back( LCL_PROP_CPPUTYPE( XFastPropertyState )); + + aTypeList = ::chart::helper::VectorToSequence( aTypes ); + } + + return aTypeList; + // \-- +} + +Sequence< sal_Int8 > SAL_CALL + OPropertySet::getImplementationId() + throw (uno::RuntimeException) +{ + static uno::Sequence< sal_Int8 > aId; + if( aId.getLength() == 0 ) + { + aId.realloc( 16 ); + rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); + } + return aId; +} + + +// ____ XPropertyState ____ +beans::PropertyState SAL_CALL + OPropertySet::getPropertyState( const OUString& PropertyName ) + throw (beans::UnknownPropertyException, + uno::RuntimeException) +{ + cppu::IPropertyArrayHelper & rPH = getInfoHelper(); + + return m_pImplProperties->GetPropertyStateByHandle( + rPH.getHandleByName( PropertyName )); +} + +Sequence< beans::PropertyState > SAL_CALL + OPropertySet::getPropertyStates( const Sequence< OUString >& aPropertyName ) + throw (beans::UnknownPropertyException, + uno::RuntimeException) +{ + cppu::IPropertyArrayHelper & rPH = getInfoHelper(); + + sal_Int32 * pHandles = new sal_Int32[ aPropertyName.getLength() ]; + rPH.fillHandles( pHandles, aPropertyName ); + + ::std::vector< sal_Int32 > aHandles( pHandles, pHandles + aPropertyName.getLength()); + delete[] pHandles; + + return m_pImplProperties->GetPropertyStatesByHandle( aHandles ); +} + +void SAL_CALL + OPropertySet::setPropertyToDefault( const OUString& PropertyName ) + throw (beans::UnknownPropertyException, + uno::RuntimeException) +{ + cppu::IPropertyArrayHelper & rPH = getInfoHelper(); + + m_pImplProperties->SetPropertyToDefault( rPH.getHandleByName( PropertyName )); +} + +Any SAL_CALL + OPropertySet::getPropertyDefault( const OUString& aPropertyName ) + throw (beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException) +{ + cppu::IPropertyArrayHelper & rPH = getInfoHelper(); + + return GetDefaultValue( rPH.getHandleByName( aPropertyName ) ); +} + + +// ____ XMultiPropertyStates ____ + +// Note: getPropertyStates() is already implemented in XPropertyState with the +// same signature + +void SAL_CALL + OPropertySet::setAllPropertiesToDefault() + throw (uno::RuntimeException) +{ + m_pImplProperties->SetAllPropertiesToDefault(); +} + +void SAL_CALL + OPropertySet::setPropertiesToDefault( const Sequence< OUString >& aPropertyNames ) + throw (beans::UnknownPropertyException, + uno::RuntimeException) +{ + cppu::IPropertyArrayHelper & rPH = getInfoHelper(); + + sal_Int32 * pHandles = new sal_Int32[ aPropertyNames.getLength() ]; + rPH.fillHandles( pHandles, aPropertyNames ); + + ::std::vector< sal_Int32 > aHandles( pHandles, pHandles + aPropertyNames.getLength()); + delete[] pHandles; + + m_pImplProperties->SetPropertiesToDefault( aHandles ); +} + +Sequence< Any > SAL_CALL + OPropertySet::getPropertyDefaults( const Sequence< OUString >& aPropertyNames ) + throw (beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException) +{ + ::cppu::IPropertyArrayHelper & rPH = getInfoHelper(); + const sal_Int32 nElements = aPropertyNames.getLength(); + + Sequence< Any > aResult( nElements ); + Any * pResultArray = aResult.getArray(); + sal_Int32 nI = 0; + + for( ; nI < nElements; ++nI ) + { + pResultArray[ nI ] = GetDefaultValue( + rPH.getHandleByName( aPropertyNames[ nI ] )); + } + + return aResult; +} + +sal_Bool SAL_CALL OPropertySet::convertFastPropertyValue + ( Any & rConvertedValue, + Any & rOldValue, + sal_Int32 nHandle, + const Any& rValue ) + throw (lang::IllegalArgumentException) +{ + getFastPropertyValue( rOldValue, nHandle ); + rConvertedValue = rValue; + return sal_True; +} + +void SAL_CALL OPropertySet::setFastPropertyValue_NoBroadcast + ( sal_Int32 nHandle, + const Any& rValue ) + throw (uno::Exception) +{ + m_pImplProperties->SetPropertyValueByHandle( nHandle, rValue ); +} + +void SAL_CALL OPropertySet::getFastPropertyValue + ( Any& rValue, + sal_Int32 nHandle ) const +{ + if( ! m_pImplProperties->GetPropertyValueByHandle( rValue, nHandle )) + { +// OSL_TRACE( "OPropertySet: asking style for property" ); + // property was not set -> try style + uno::Reference< beans::XFastPropertySet > xStylePropSet( m_pImplProperties->GetStyle(), uno::UNO_QUERY ); + if( xStylePropSet.is() ) + { +#ifndef NDEBUG + { + // check if the handle of the style points to the same property + // name as the handle in this property set + uno::Reference< beans::XPropertySet > xPropSet( xStylePropSet, uno::UNO_QUERY ); + if( xPropSet.is()) + { + uno::Reference< beans::XPropertySetInfo > xInfo( xPropSet->getPropertySetInfo(), + uno::UNO_QUERY ); + if( xInfo.is() ) + { + // for some reason the virtual method getInfoHelper() is + // not const + ::cppu::IPropertyArrayHelper & rPH = + const_cast< OPropertySet * >( this )->getInfoHelper(); + + // find the Property with Handle nHandle in Style + Sequence< beans::Property > aProps( xInfo->getProperties() ); + sal_Int32 nI = aProps.getLength() - 1; + while( ( nI >= 0 ) && nHandle != aProps[ nI ].Handle ) + --nI; + + if( nI >= 0 ) // => nHandle == aProps[nI].Handle + { + // check whether the handle in this property set is + // the same as the one in the style + beans::Property aProp( rPH.getPropertyByName( aProps[ nI ].Name ) ); + OSL_ENSURE( nHandle == aProp.Handle, + "HandleCheck: Handles for same property differ!" ); + + if( nHandle == aProp.Handle ) + { + OSL_ENSURE( aProp.Type == aProps[nI].Type, + "HandleCheck: Types differ!" ); + OSL_ENSURE( aProp.Attributes == aProps[nI].Attributes, + "HandleCheck: Attributes differ!" ); + } + } + else + { + OSL_ENSURE( false, "HandleCheck: Handle not found in Style" ); + } + } + else + OSL_ENSURE( false, "HandleCheck: Invalid XPropertySetInfo returned" ); + } + else + OSL_ENSURE( false, "HandleCheck: XPropertySet not supported" ); + } +#endif + rValue = xStylePropSet->getFastPropertyValue( nHandle ); + } + else + { +// OSL_TRACE( "OPropertySet: no style => getting default for property" ); + // there is no style (or the style does not support XFastPropertySet) + // => take the default value + try + { + rValue = GetDefaultValue( nHandle ); + } + catch( beans::UnknownPropertyException ex ) + { + rValue.clear(); + } + } + } +} + +// ____ XStyleSupplier ____ +Reference< style::XStyle > SAL_CALL OPropertySet::getStyle() + throw (uno::RuntimeException) +{ + return m_pImplProperties->GetStyle(); +} + +void SAL_CALL OPropertySet::setStyle( const Reference< style::XStyle >& xStyle ) + throw (lang::IllegalArgumentException, + uno::RuntimeException) +{ + if( ! m_pImplProperties->SetStyle( xStyle )) + throw lang::IllegalArgumentException( + OUString( RTL_CONSTASCII_USTRINGPARAM( "Empty Style" )), + static_cast< beans::XPropertySet * >( this ), + 0 ); +} + +// ____ XFastPropertyState ____ +// beans::PropertyState OPropertySet::SAL_CALL getFastPropertyState( sal_Int32 nHandle ) +// throw (beans::UnknownPropertyException, +// uno::RuntimeException) +// { +// return m_pImplProperties->GetPropertyStateByHandle( nHandle ); +// } + +// uno::Sequence< beans::PropertyState > OPropertySet::SAL_CALL getFastPropertyStates( +// const uno::Sequence< sal_Int32 >& aHandles ) +// throw (beans::UnknownPropertyException, +// uno::RuntimeException) +// { +// ::std::vector< sal_Int32 > aHandleVec( +// aHandles.getConstArray(), +// aHandles.getConstArray() + aHandles.getLength() ); + +// return m_pImplProperties->GetPropertyStatesByHandle( aHandleVec ); +// } + +// void OPropertySet::SAL_CALL setFastPropertyToDefault( sal_Int32 nHandle ) +// throw (beans::UnknownPropertyException, +// uno::RuntimeException) +// { +// m_pImplProperties->SetPropertyToDefault( nHandle ); +// } + +// uno::Any OPropertySet::SAL_CALL getFastPropertyDefault( sal_Int32 nHandle ) +// throw (beans::UnknownPropertyException, +// lang::WrappedTargetException, +// uno::RuntimeException) +// { +// return GetDefaultValue( nHandle ); +// } + + +} // namespace property diff --git a/chart2/source/tools/OStyle.cxx b/chart2/source/tools/OStyle.cxx new file mode 100644 index 000000000000..0ca5f6675afc --- /dev/null +++ b/chart2/source/tools/OStyle.cxx @@ -0,0 +1,265 @@ +/************************************************************************* + * + * $RCSfile: OStyle.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "OStyle.hxx" +#include "macros.hxx" + +#ifndef _RTL_UUID_H_ +#include <rtl/uuid.h> +#endif +#ifndef _CPPUHELPER_QUERYINTERFACE_HXX_ +#include <cppuhelper/queryinterface.hxx> +#endif + +using namespace ::com::sun::star; + +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::Reference; +using ::rtl::OUString; +using ::osl::MutexGuard; + +namespace property +{ + +OStyle::OStyle( const Reference< container::XNameAccess > & xStyleFamily, + ::osl::Mutex & _rMutex ) : + OPropertySet( _rMutex ), + m_xStyleFamily( xStyleFamily ), + m_bUserDefined( false ), + m_rMutex( _rMutex ) +{} + +OStyle::~OStyle() +{} + +::osl::Mutex & OStyle::GetMutex() +{ + return m_rMutex; +} + +// ____ XStyle ____ +sal_Bool SAL_CALL OStyle::isUserDefined() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return m_bUserDefined; + // \-- +} + +sal_Bool SAL_CALL OStyle::isInUse() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + + // aBoundLC is a member of cppuhelper::OPropertySetHelper + // it is assumed that a style is in use whenever some component is + // registered here as listener + return ( aBoundLC.getContainedTypes().getLength() > 0 ); + // \-- +} + +OUString SAL_CALL OStyle::getParentStyle() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return m_aParentStyleName; + // \-- +} + +void SAL_CALL OStyle::setParentStyle( const OUString& aParentStyle ) + throw (container::NoSuchElementException, + uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + m_aParentStyleName = aParentStyle; + // \-- +} + +// ____ XNamed (base of XStyle) ____ + +OUString SAL_CALL OStyle::getName() + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + return m_aName; + // \-- +} + +void SAL_CALL OStyle::setName( const ::rtl::OUString& aName ) + throw (uno::RuntimeException) +{ + // /-- + MutexGuard aGuard( GetMutex() ); + OSL_ASSERT( m_xStyleFamily.is() ); + + // note: RuntimeException is not very apropriate for this, but I have no + // other choice + if( m_xStyleFamily->hasByName( aName )) + { + OSL_ENSURE( false, "Style name already exists!" ); + throw uno::RuntimeException( + C2U( "Style name already exists: " ) + aName, + static_cast< style::XStyle * >( this )); + } + else + { + // ToDo: Change the name in the container (XStyleFamiliy) + m_aName = aName; + } + // \-- +} + +// ____ XInterface ____ +uno::Any SAL_CALL OStyle::queryInterface( const uno::Type& aType ) + throw (uno::RuntimeException) +{ + uno::Any aResult = OPropertySet::queryInterface( aType ); + + if( ! aResult.hasValue()) + { + return ::cppu::queryInterface( + aType, + static_cast< style::XStyle * >( this )); + } + + return aResult; +} + +// void SAL_CALL OStyle::acquire() throw () +// { +// OPropertySet::acquire(); +// } + +// void SAL_CALL OStyle::release() throw () +// { +// OPropertySet::release(); +// } + + + +// ____ XServiceInfo ____ +// OUString SAL_CALL +// OStyle::getImplementationName() +// throw (uno::RuntimeException) +// { +// return OUString( RTL_CONSTASCII_USTRINGPARAM( "property::OStyle" )); +// } + +// sal_Bool SAL_CALL +// OStyle::supportsService( const OUString& ServiceName ) +// throw (uno::RuntimeException) +// { +// Sequence< OUString > aServices( getSupportedServiceNames() ); + +// sal_Int32 nI = aServices.getLength() - 1; +// for( ; nI >= 0; --nI ) +// { +// if( aServices[ nI ].equals( ServiceName )) +// return sal_True; +// } +// return sal_False; +// } + +// Sequence< OUString > SAL_CALL +// OStyle::getSupportedServiceNames() +// throw (uno::RuntimeException) +// { +// Sequence< OUString > aServiceNames( 2 ); +// // from base OPropertySet +// aServiceNames[ 0 ] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.PropertySet" )); +// // new service +// aServiceNames[ 1 ] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.style.Style" )); +// return aServiceNames; +// } + + +// ____ XTypeProvider ____ +// Sequence< uno::Type > SAL_CALL +// OStyle::getTypes() +// throw (uno::RuntimeException) +// { +// Sequence< uno::Type > aResult( OPropertySet::getTypes() ); +// aResult.realloc( aResult.getLength() + 1 ); +// aResult[ aResult.getLength() - 1 ] = +// ::getCppuType( reinterpret_cast< const Reference< style::XStyle > *>(0)); + +// return aResult; +// } + +// Sequence< sal_Int8 > SAL_CALL +// OStyle::getImplementationId() +// throw (uno::RuntimeException) +// { +// static uno::Sequence< sal_Int8 > aId; +// if( aId.getLength() == 0 ) +// { +// aId.realloc( 16 ); +// rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); +// } +// return aId; +// } + + +} // namespace property diff --git a/chart2/source/tools/Scaling.cxx b/chart2/source/tools/Scaling.cxx new file mode 100644 index 000000000000..13215b248c16 --- /dev/null +++ b/chart2/source/tools/Scaling.cxx @@ -0,0 +1,232 @@ +/************************************************************************* + * + * $RCSfile: Scaling.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_SCALING_HXX +#include "Scaling.hxx" +#endif + +#ifndef INCLUDED_RTL_MATH_HXX +#include <rtl/math.hxx> +#endif + +namespace +{ + +static const ::rtl::OUString lcl_aServiceName_Logarithmic( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.LogarithmicScaling" )); +static const ::rtl::OUString lcl_aServiceName_Exponential( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.ExponentialScaling" )); +static const ::rtl::OUString lcl_aServiceName_Linear( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.LinearScaling" )); +static const ::rtl::OUString lcl_aServiceName_Power( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.PowerScaling" )); +} + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +LogarithmicScaling::LogarithmicScaling() : + m_fBase( 10.0 ), + m_fLogOfBase( log( 10.0 ) ) +{ +} + +LogarithmicScaling::LogarithmicScaling( double fBase ) : + m_fBase( fBase ), + m_fLogOfBase( log( fBase ) ) +{ +} + +LogarithmicScaling::~LogarithmicScaling() +{ +} + + double SAL_CALL +LogarithmicScaling::doScaling( double value ) + throw (uno::RuntimeException) +{ + return log( value ) / m_fLogOfBase; +} + + uno::Reference< XScaling > SAL_CALL +LogarithmicScaling::getInverseScaling() + throw (uno::RuntimeException) +{ + return new ExponentialScaling( m_fBase ); +} + + ::rtl::OUString SAL_CALL +LogarithmicScaling::getServiceName() + throw (uno::RuntimeException) +{ + return lcl_aServiceName_Logarithmic; +} + +// ---------------------------------------- + +ExponentialScaling::ExponentialScaling() : + m_fBase( 10.0 ) +{ +} + +ExponentialScaling::ExponentialScaling( double fBase ) : + m_fBase( fBase ) +{ +} + +ExponentialScaling::~ExponentialScaling() +{ +} + + double SAL_CALL +ExponentialScaling::doScaling( double value ) + throw (uno::RuntimeException) +{ + return pow( m_fBase, value ); +} + + uno::Reference< XScaling > SAL_CALL +ExponentialScaling::getInverseScaling() + throw (uno::RuntimeException) +{ + return new LogarithmicScaling( m_fBase ); +} + + ::rtl::OUString SAL_CALL +ExponentialScaling::getServiceName() + throw (uno::RuntimeException) +{ + return lcl_aServiceName_Exponential; +} + +// ---------------------------------------- + +LinearScaling::LinearScaling( double fSlope, double fOffset ) : + m_fSlope( fSlope ), + m_fOffset( fOffset ) +{} + +LinearScaling::~LinearScaling() +{} + +double SAL_CALL LinearScaling::doScaling( double value ) + throw (uno::RuntimeException) +{ + return m_fOffset + m_fSlope * value; +} + +uno::Reference< XScaling > SAL_CALL + LinearScaling::getInverseScaling() + throw (uno::RuntimeException) +{ + // ToDo: ApproxEqual ? + if( m_fSlope == 0 ) + throw uno::RuntimeException(); + + return new LinearScaling( 1.0 / m_fSlope, m_fOffset / m_fSlope ); +} + + ::rtl::OUString SAL_CALL +LinearScaling::getServiceName() + throw (uno::RuntimeException) +{ + return lcl_aServiceName_Linear; +} + +// ---------------------------------------- + +PowerScaling::PowerScaling( double fExponent ) : + m_fExponent( fExponent ) +{} + +PowerScaling::~PowerScaling() +{} + +double SAL_CALL PowerScaling::doScaling( double value ) + throw (uno::RuntimeException) +{ + return pow( value, m_fExponent ); +} + +uno::Reference< XScaling > SAL_CALL + PowerScaling::getInverseScaling() + throw (uno::RuntimeException) +{ + // ToDo: ApproxEqual ? + if( m_fExponent == 0 ) + throw uno::RuntimeException(); + + return new PowerScaling( 1.0 / m_fExponent ); +} + + ::rtl::OUString SAL_CALL +PowerScaling::getServiceName() + throw (uno::RuntimeException) +{ + return lcl_aServiceName_Power; +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/tools/TitleHelper.cxx b/chart2/source/tools/TitleHelper.cxx new file mode 100644 index 000000000000..2cac24c671e7 --- /dev/null +++ b/chart2/source/tools/TitleHelper.cxx @@ -0,0 +1,241 @@ +/************************************************************************* + * + * $RCSfile: TitleHelper.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "TitleHelper.hxx" +#include "ChartModelHelper.hxx" +#include "macros.hxx" +#include "ContextHelper.hxx" + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTDOCUMENT_HPP_ +#include <drafts/com/sun/star/chart2/XChartDocument.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +rtl::OUString TitleHelper::getIdentifierForTitle( TitleHelper::eTitleType nTitleIndex ) +{ + switch( nTitleIndex ) + { + case MAIN_TITLE: + { + static rtl::OUString m_aIdentifier( C2U( "@main-title" ) ); + return m_aIdentifier; + } + case SUB_TITLE: + { + static rtl::OUString m_aIdentifier( C2U( "@sub-title" ) ); + return m_aIdentifier; + } + case X_AXIS_TITLE: + { + static rtl::OUString m_aIdentifier( C2U( "@xaxis-title" ) ); + return m_aIdentifier; + } + case Y_AXIS_TITLE: + { + static rtl::OUString m_aIdentifier( C2U( "@yaxis-title" ) ); + return m_aIdentifier; + } + case Z_AXIS_TITLE: + { + static rtl::OUString m_aIdentifier( C2U( "@zaxis-title" ) ); + return m_aIdentifier; + } + default: + OSL_ENSURE( false, "Unsupported Title-Type requested" ); + return ::rtl::OUString(); + } +} + +uno::Reference< XTitled > lcl_getTitleParent( TitleHelper::eTitleType nTitleIndex + , const uno::Reference< frame::XModel >& xModel ) +{ + switch( nTitleIndex ) + { + case TitleHelper::MAIN_TITLE: + return uno::Reference< XTitled >( xModel, uno::UNO_QUERY ); + case TitleHelper::SUB_TITLE: + { + uno::Reference< XChartDocument > xChartDoc( xModel, uno::UNO_QUERY ); + if( !xChartDoc.is()) + return NULL; + return uno::Reference< XTitled >( xChartDoc->getDiagram(), uno::UNO_QUERY ); + } + case TitleHelper::X_AXIS_TITLE: + //@todo + break; + case TitleHelper::Y_AXIS_TITLE: + //@todo + break; + case TitleHelper::Z_AXIS_TITLE: + //@todo + break; + default: + OSL_ENSURE( false, "Unsupported Title-Type requested" ); + return NULL; + } +} + +uno::Reference< XTitle > TitleHelper::getTitle( TitleHelper::eTitleType nTitleIndex + , const uno::Reference< frame::XModel >& xModel ) +{ + uno::Reference< XTitled > xTitled( lcl_getTitleParent( nTitleIndex, xModel ) ); + if( xTitled.is()) + return xTitled->getTitle(); + return NULL; +} + +uno::Reference< XTitle > TitleHelper::createTitle( + TitleHelper::eTitleType nTitleIndex + , const rtl::OUString& rTitleText + , const uno::Reference< frame::XModel >& xModel + , const uno::Reference< uno::XComponentContext > & xContext ) +{ + if( !rTitleText.getLength() ) + return NULL; + + uno::Reference< XTitle > xTitle(NULL); + uno::Reference< XTitled > xTitled( lcl_getTitleParent( nTitleIndex, xModel ) ); + + ContextHelper::tContextEntryMapType aContextValues( + ContextHelper::MakeContextEntryMap( C2U( "Identifier" ) + , uno::makeAny( TitleHelper::getIdentifierForTitle(nTitleIndex) )) ); + uno::Reference< uno::XComponentContext > xNewContext( + ContextHelper::createContext( aContextValues, xContext ) ); + + if(xNewContext.is() && xTitled.is()) + { + xTitle.set( xContext->getServiceManager()->createInstanceWithContext( + C2U( "drafts.com.sun.star.chart2.Title" ), + xNewContext ), uno::UNO_QUERY ); + + if(xTitle.is()) + { + setCompleteString( rTitleText, xTitle, xNewContext ); + xTitled->setTitle( xTitle ); + } + } + return xTitle; +} + +rtl::OUString TitleHelper::getCompleteString( const uno::Reference< XTitle >& xTitle ) +{ + rtl::OUString aRet; + if(!xTitle.is()) + return aRet; + uno::Sequence< uno::Reference< XFormattedString > > aStringList = xTitle->getText(); + for( sal_Int32 nN=0; nN<aStringList.getLength();nN++ ) + aRet += aStringList[nN]->getString(); + return aRet; +} + +void TitleHelper::setCompleteString( const rtl::OUString& rNewText + , const uno::Reference< XTitle >& xTitle + , const uno::Reference< uno::XComponentContext > & xContext ) +{ + //the format of the first old text portion will be maintained if there is any + if(!xTitle.is()) + return; + + uno::Sequence< uno::Reference< XFormattedString > > aNewStringList(1); + + uno::Sequence< uno::Reference< XFormattedString > > aOldStringList = xTitle->getText(); + if( aOldStringList.getLength() ) + { + aNewStringList[0].set( aOldStringList[0] ); + aNewStringList[0]->setString( rNewText ); + } + else + { + uno::Reference< uno::XInterface > xI( + xContext->getServiceManager()->createInstanceWithContext( + C2U( "drafts.com.sun.star.chart2.FormattedString" ), xContext ) ); + uno::Reference< XFormattedString > xFormattedString( xI, uno::UNO_QUERY ); + + if(xFormattedString.is()) + { + xFormattedString->setString( rNewText ); + aNewStringList[0].set( xFormattedString ); + } + } + xTitle->setText( aNewStringList ); +} + +void TitleHelper::removeTitle( TitleHelper::eTitleType nTitleIndex + , const ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel >& xModel ) +{ + uno::Reference< XTitled > xTitled( lcl_getTitleParent( nTitleIndex, xModel ) ); + if( xTitled.is()) + { + xTitled->setTitle(NULL); + } +} + +//............................................................................. +} //namespace chart +//............................................................................. + diff --git a/chart2/source/tools/exports.flt b/chart2/source/tools/exports.flt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/chart2/source/tools/exports.flt diff --git a/chart2/source/tools/makefile.mk b/chart2/source/tools/makefile.mk new file mode 100644 index 000000000000..21392c341ba3 --- /dev/null +++ b/chart2/source/tools/makefile.mk @@ -0,0 +1,166 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ= ..$/.. +PRJNAME= chart2 +TARGET= charttools + +PRJINC= $(PRJ)$/source + +USE_DEFFILE= TRUE +ENABLE_EXCEPTIONS= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: $(PRJ)$/util$/makefile.pmk + +# --- export library ------------------------------------------------- + +#You can use several library macros of this form to build libraries that +#do not consist of all object files in a directory or to merge different libraries. +#LIB1TARGET= $(SLB)$/_$(TARGET).lib + +#Specifies object files to bind into linked libraries. +SLOFILES= \ + $(SLO)$/LifeTime.obj \ + $(SLO)$/MediaDescriptorHelper.obj \ + $(SLO)$/CommonConverters.obj \ + $(SLO)$/ContextHelper.obj \ + $(SLO)$/ImplOPropertySet.obj \ + $(SLO)$/OChartElementContainerHelper.obj \ + $(SLO)$/OEnumeration.obj \ + $(SLO)$/OIndexContainer.obj \ + $(SLO)$/OPropertySet.obj \ + $(SLO)$/OStyle.obj \ + $(SLO)$/Scaling.obj \ + $(SLO)$/ChartModelHelper.obj \ + $(SLO)$/MeterHelper.obj \ + $(SLO)$/MutexContainer.obj \ + $(SLO)$/TitleHelper.obj \ + $(SLO)$/LegendHelper.obj + +LIB1OBJFILES = $(SLOFILES) + +#-------- + +#Indicates the filename of the shared library. +SHL1TARGET= $(TARGET)$(UPD)$(DLLPOSTFIX) + +#indicates dependencies: +SHL1DEPN= +#Specifies an import library to create. For Win32 only. +SHL1IMPLIB= i$(TARGET) + +#Specifies libraries from the same module to put into the shared library. +#was created above +SHL1LIBS= $(SLB)$/$(TARGET).lib + +#Links import libraries. + +SHL1STDLIBS= \ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(SALLIB) \ + $(TOOLSLIB) + +# $(COMPHELPERLIB) \ +# $(GOODIESLIB) \ +# $(SVLIB) \ +# $(SVLLIB) \ +# $(SVTOOLLIB) \ +# $(SVXLIB) \ +# $(TKLIB) \ +# $(VCLLIB) \ +# $(SFXLIB) + +#--------exports + +#specifies the exported symbols for Windows only: +SHL1DEF= $(MISC)$/$(SHL1TARGET).def + +#Specifies the library name to parse for symbols. For Win32 only. +#DEFLIB1NAME= _$(TARGET) + +#A file of symbols to export. +#DEF1EXPORTFILE= $(PRJ)$/source$/inc$/exports.dxp + +#--------definition file + +#name of the definition file: +DEF1NAME= $(SHL1TARGET) + +# indicates definition file dependencies +DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt + +#A comment on the definition file. +DEF1DES= Chart Tools + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk + +# --- Filter ----------------------------------------------------------- + +$(MISC)$/$(SHL1TARGET).flt: makefile.mk \ + exports.flt + +$(TYPE) exports.flt > $@ + diff --git a/chart2/source/tools/tools.map b/chart2/source/tools/tools.map new file mode 100644 index 000000000000..7698cb349177 --- /dev/null +++ b/chart2/source/tools/tools.map @@ -0,0 +1,9 @@ +CHART_1_0 { + global: + component_getImplementationEnvironment; + component_writeInfo; + component_getFactory; + component_getDescriptionFunc; + local: + *; +}; diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx new file mode 100644 index 000000000000..6f9c14700778 --- /dev/null +++ b/chart2/source/view/axes/ScaleAutomatism.cxx @@ -0,0 +1,357 @@ +/************************************************************************* + * + * $RCSfile: ScaleAutomatism.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ScaleAutomatism.hxx" +#include "macros.hxx" +#include "TickmarkHelper.hxx" + +#ifndef _COM_SUN_STAR_LANG_XSERVICENAME_HPP_ +#include <com/sun/star/lang/XServiceName.hpp> +#endif + +#ifndef INCLUDED_RTL_MATH_HXX +#include <rtl/math.hxx> +#endif + +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +ScaleAutomatism::ScaleAutomatism( const ScaleData& rSourceScale ) + : m_fValueMinimum( 0.0 ) + , m_fValueMaximum( 0.0 ) + , m_nMaximumAutomaticMainIncrementCount(10) + , m_aSourceScale( rSourceScale ) + , m_aSourceIncrement() + , m_aSourceSubIncrementList() +{ + ::rtl::math::setNan( &m_fValueMinimum ); + ::rtl::math::setNan( &m_fValueMaximum ); +} + +ScaleAutomatism::ScaleAutomatism( const ScaleData& rSourceScale + , const IncrementData& rSourceIncrement + , const uno::Sequence< SubIncrement >& rSourceSubIncrementList ) + : m_fValueMinimum( 0.0 ) + , m_fValueMaximum( 0.0 ) + , m_nMaximumAutomaticMainIncrementCount(9) + , m_aSourceScale( rSourceScale ) + , m_aSourceIncrement( rSourceIncrement ) + , m_aSourceSubIncrementList( rSourceSubIncrementList ) +{ + ::rtl::math::setNan( &m_fValueMinimum ); + ::rtl::math::setNan( &m_fValueMaximum ); +} + +ScaleAutomatism::~ScaleAutomatism() +{ +} + +//@todo these method should become part of the scaling interface and implementation somehow +//@todo problem with outparamters at api +ExplicitIncrementData getExplicitIncrementAndScaleForLogarithm( + bool bChangeMinimumToIncrementRythm, bool bChangeMaximumToIncrementRythm + , sal_Int32 nMaximumAutomaticMainIncrementCount + , ExplicitScaleData& rExplicitScale + , const IncrementData& rSourceIncrement + , const uno::Sequence< SubIncrement >& rSourceSubIncrementList ) +{ + //minimum and maximum of the ExplicitScaleData may be changed + //to suiteable values if allowed + //but they will definitly be changed if they are out of allowed borders + + if( nMaximumAutomaticMainIncrementCount <= 0 ) + nMaximumAutomaticMainIncrementCount = 5; + + //make sure that minimum and maximum are not out of allowed range + { + if( rExplicitScale.Maximum<=0.0 ) + rExplicitScale.Maximum = 100.0; + if( rExplicitScale.Minimum<=0.0 ) + { + rExplicitScale.Minimum = 0.1; + if( rExplicitScale.Minimum >= rExplicitScale.Maximum ) + rExplicitScale.Minimum = log(rExplicitScale.Maximum)/10.0; + } + } + + ExplicitIncrementData aRet; + if(!(rSourceIncrement.PostEquidistant>>=aRet.PostEquidistant)) + { + //maybe scaling dependent + aRet.PostEquidistant = sal_True; + } + if(!(rSourceIncrement.Distance>>=aRet.Distance)) + { + //autocalculate the distance + if(aRet.PostEquidistant && rExplicitScale.Scaling.is() ) + { + double fRange = rExplicitScale.Scaling->doScaling( rExplicitScale.Maximum ) + - rExplicitScale.Scaling->doScaling( rExplicitScale.Minimum ); + double fSlice = fRange/nMaximumAutomaticMainIncrementCount; + //make a fine value out of fSlice now: + //only integers are reasonable as distance values + sal_Int32 nDistance = static_cast<sal_Int32>(fSlice); + if(nDistance<=0) + nDistance=1; + aRet.Distance = nDistance; + } + else + { + //@todo this was not tested + double fRange = rExplicitScale.Maximum - rExplicitScale.Minimum; + double fSlice = fRange/nMaximumAutomaticMainIncrementCount; + //make a fine value out of fSlice now: + double fSliceMagnitude = pow (10, floor (log10 (fSlice))); + aRet.Distance = static_cast<sal_Int32>(fSlice/fSliceMagnitude)*fSliceMagnitude; + } + } + + if(!(rSourceIncrement.BaseValue>>=aRet.BaseValue)) + { + //scaling dependent + //@maybe todo is this default also plotter dependent ?? + aRet.BaseValue = 1.0; + } + else if( aRet.BaseValue<=0.0 ) //make sure that BaseValue is not out of allowed ranges + aRet.BaseValue = 1.0; + + if(bChangeMinimumToIncrementRythm) + { + double fMin = rExplicitScale.Minimum; + if( aRet.PostEquidistant && rExplicitScale.Scaling.is() ) + fMin = rExplicitScale.Scaling->doScaling(fMin); + + fMin = TickmarkHelper::getMinimumAtIncrement( fMin, aRet ); + if( aRet.PostEquidistant && rExplicitScale.Scaling.is() ) + fMin = rExplicitScale.Scaling->getInverseScaling()->doScaling(fMin); + rExplicitScale.Minimum = fMin; + + if( rExplicitScale.Minimum<=0.0 ) + { + rExplicitScale.Minimum = 0.1; + if( rExplicitScale.Minimum >= rExplicitScale.Maximum ) + rExplicitScale.Minimum = log(rExplicitScale.Maximum)/10.0; + } + } + if(bChangeMaximumToIncrementRythm) + { + double fMax = rExplicitScale.Maximum; + if( aRet.PostEquidistant && rExplicitScale.Scaling.is() ) + fMax = rExplicitScale.Scaling->doScaling(fMax); + fMax = TickmarkHelper::getMaximumAtIncrement( fMax, aRet ); + if( aRet.PostEquidistant && rExplicitScale.Scaling.is() ) + fMax = rExplicitScale.Scaling->getInverseScaling()->doScaling(fMax); + rExplicitScale.Maximum = fMax; + } + //--------------------------------------------------------------- + //fill explicit sub increment + sal_Int32 nSubCount = rSourceSubIncrementList.getLength(); + aRet.SubIncrements.realloc(nSubCount); + for( sal_Int32 nN=0; nN<nSubCount; nN++ ) + { + const SubIncrement& rSubIncrement = rSourceSubIncrementList[nN]; + ExplicitSubIncrement& rExplicitSubIncrement = aRet.SubIncrements[nN]; + + if(!(rSubIncrement.IntervalCount>>=rExplicitSubIncrement.IntervalCount)) + { + //scaling dependent + //@todo autocalculate IntervalCount dependent on MainIncrement and scaling + rExplicitSubIncrement.IntervalCount = 5; + } + if(!(rSubIncrement.PostEquidistant>>=rExplicitSubIncrement.PostEquidistant)) + { + //scaling dependent + rExplicitSubIncrement.PostEquidistant = sal_False; + } + } + return aRet; +} + +ExplicitIncrementData getExplicitIncrementAndScaleForLinear( + bool bChangeMinimumToIncrementRythm, bool bChangeMaximumToIncrementRythm + , sal_Int32 nMaximumAutomaticMainIncrementCount + , ExplicitScaleData& rExplicitScale + , const IncrementData& rSourceIncrement + , const uno::Sequence< SubIncrement >& rSourceSubIncrementList ) +{ + //minimum and maximum of the ExplicitScaleData may be changed + //to suiteable values if allowed + //but they will definitly be changed if they are out of allowed borders + + ExplicitIncrementData aRet; + if(!(rSourceIncrement.PostEquidistant>>=aRet.PostEquidistant)) + { + //maybe scaling dependent + aRet.PostEquidistant = sal_True; + } + if(!(rSourceIncrement.Distance>>=aRet.Distance)) + { + //autocalculate the distance + double fRange = rExplicitScale.Maximum - rExplicitScale.Minimum; + double fSlice = fRange/nMaximumAutomaticMainIncrementCount; + + //make a fine value out of fSlice now: + double fSliceMagnitude = pow (10, floor (log10 (fSlice))); + fSlice /= fSliceMagnitude; + if(fSlice<=1.0) + fSlice=1.0; + else if( fSlice<= 2.0 ) + fSlice=2.0; + else if( fSlice<= 2.5 ) + fSlice=2.5; + else if( fSlice<= 5.0) + fSlice=5.0; + else + fSlice=10.0; + + aRet.Distance = fSlice*fSliceMagnitude; + } + if(!(rSourceIncrement.BaseValue>>=aRet.BaseValue)) + { + //@maybe todo is this default also plotter dependent ?? + aRet.BaseValue = 0.0; + } + if(bChangeMinimumToIncrementRythm) + { + rExplicitScale.Minimum = TickmarkHelper::getMinimumAtIncrement( rExplicitScale.Minimum, aRet ); + } + if(bChangeMaximumToIncrementRythm) + { + rExplicitScale.Maximum = TickmarkHelper::getMaximumAtIncrement( rExplicitScale.Maximum, aRet ); + } + //--------------------------------------------------------------- + //fill explicit sub increment + sal_Int32 nSubCount = rSourceSubIncrementList.getLength(); + aRet.SubIncrements.realloc(nSubCount); + for( sal_Int32 nN=0; nN<nSubCount; nN++ ) + { + const SubIncrement& rSubIncrement = rSourceSubIncrementList[nN]; + ExplicitSubIncrement& rExplicitSubIncrement = aRet.SubIncrements[nN]; + + if(!(rSubIncrement.IntervalCount>>=rExplicitSubIncrement.IntervalCount)) + { + //scaling dependent + //@todo autocalculate IntervalCount dependent on MainIncrement and scaling + rExplicitSubIncrement.IntervalCount = 2; + } + if(!(rSubIncrement.PostEquidistant>>=rExplicitSubIncrement.PostEquidistant)) + { + //scaling dependent + rExplicitSubIncrement.PostEquidistant = sal_False; + } + } + return aRet; +} + +void ScaleAutomatism::calculateExplicitScaleAndIncrement( + ExplicitScaleData& rExplicitScale + , ExplicitIncrementData& rExplicitIncrement ) +{ + //--------------------------------------------------------------- + //fill explicit scale + bool bChangeMinimumToIncrementRythm=false, bChangeMaximumToIncrementRythm=false; + if(!(m_aSourceScale.Minimum>>=rExplicitScale.Minimum)) + { + //autocalculate the minimum in first iteration + //the increment is considered below + if( !::rtl::math::isNan(m_fValueMinimum) ) + rExplicitScale.Minimum = m_fValueMinimum; + else + rExplicitScale.Minimum = 0.0;//@todo get Minimum from scsaling or from plotter???? + bChangeMinimumToIncrementRythm = true; + } + if(!(m_aSourceScale.Maximum>>=rExplicitScale.Maximum)) + { + //autocalculate the maximum in first iteration + //the increment is considered below + if( !::rtl::math::isNan(m_fValueMaximum) ) + rExplicitScale.Maximum = m_fValueMaximum; + else + rExplicitScale.Maximum = 10.0;//@todo get Maximum from scaling or from plotter???? + bChangeMaximumToIncrementRythm=true; + } + rExplicitScale.Orientation = m_aSourceScale.Orientation;//AxisOrientation_MATHEMATICAL; + rExplicitScale.Scaling = m_aSourceScale.Scaling; + rExplicitScale.Breaks = m_aSourceScale.Breaks; + //--------------------------------------------------------------- + //fill explicit increment + //minimum and maximum of the ExplicitScaleData may be changed if allowed + uno::Reference< lang::XServiceName > xServiceName( rExplicitScale.Scaling, uno::UNO_QUERY ); + bool bIsLogarithm = ( xServiceName.is() && (xServiceName->getServiceName()).equals( + C2U( "com.sun.star.chart2.LogarithmicScaling" ))); + if(bIsLogarithm) + rExplicitIncrement = getExplicitIncrementAndScaleForLogarithm( bChangeMinimumToIncrementRythm, bChangeMaximumToIncrementRythm, m_nMaximumAutomaticMainIncrementCount + , rExplicitScale, m_aSourceIncrement, m_aSourceSubIncrementList ); + else + rExplicitIncrement = getExplicitIncrementAndScaleForLinear( bChangeMinimumToIncrementRythm, bChangeMaximumToIncrementRythm, m_nMaximumAutomaticMainIncrementCount + , rExplicitScale, m_aSourceIncrement, m_aSourceSubIncrementList ); +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/axes/TickmarkHelper.cxx b/chart2/source/view/axes/TickmarkHelper.cxx new file mode 100644 index 000000000000..5c2563f134a7 --- /dev/null +++ b/chart2/source/view/axes/TickmarkHelper.cxx @@ -0,0 +1,797 @@ +/************************************************************************* + * + * $RCSfile: TickmarkHelper.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "TickmarkHelper.hxx" +#include "ViewDefines.hxx" + +#ifndef INCLUDED_RTL_MATH_HXX +#include <rtl/math.hxx> +#endif +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; +using namespace ::rtl::math; + +TickInfo::TickInfo() +: fScaledTickValue( 0.0 ) +, fUnscaledTickValue( 0.0 ) +, nScreenTickValue( 0 ) +, bPaintIt( true ) +, xTextShape( NULL ) +{ +} + +void TickInfo::updateUnscaledValue( const uno::Reference< XScaling >& xInverseScaling ) +{ + if( xInverseScaling.is() ) + this->fUnscaledTickValue = xInverseScaling->doScaling( this->fScaledTickValue ); + else + this->fUnscaledTickValue = this->fScaledTickValue; +} + +TickIter::TickIter( const uno::Sequence< uno::Sequence< double > >& rTicks + , const ExplicitIncrementData& rIncrement + , sal_Int32 nMinDepth, sal_Int32 nMaxDepth ) + : m_pSimpleTicks(&rTicks), m_pInfoTicks(NULL) + , m_rIncrement(rIncrement) + , m_nMinDepth(0), m_nMaxDepth(0) + , m_nTickCount(0), m_pnPositions(NULL) + , m_pnPreParentCount(NULL), m_pbIntervalFinished(NULL) + , m_nCurrentDepth(-1), m_nCurrentPos(-1), m_fCurrentValue( 0.0 ) +{ + initIter( nMinDepth, nMaxDepth ); +} + +TickIter::TickIter( ::std::vector< ::std::vector< TickInfo > >& rTicks + , const ExplicitIncrementData& rIncrement + , sal_Int32 nMinDepth, sal_Int32 nMaxDepth ) + : m_pSimpleTicks(NULL), m_pInfoTicks(&rTicks) + , m_rIncrement(rIncrement) + , m_nMinDepth(0), m_nMaxDepth(0) + , m_nTickCount(0), m_pnPositions(NULL) + , m_pnPreParentCount(NULL), m_pbIntervalFinished(NULL) + , m_nCurrentDepth(-1), m_nCurrentPos(-1), m_fCurrentValue( 0.0 ) +{ + initIter( nMinDepth, nMaxDepth ); +} + +void TickIter::initIter( sal_Int32 nMinDepth, sal_Int32 nMaxDepth ) +{ + m_nMaxDepth = nMaxDepth; + if(nMaxDepth<0 || m_nMaxDepth>_getMaxDepth()) + m_nMaxDepth=_getMaxDepth(); + + sal_Int32 nDepth = 0; + for( nDepth = 0; nDepth<=m_nMaxDepth ;nDepth++ ) + m_nTickCount += _getTickCount(nDepth); + + if(!m_nTickCount) + return; + + m_pnPositions = new sal_Int32[m_nMaxDepth+1]; + + m_pnPreParentCount = new sal_Int32[m_nMaxDepth+1]; + m_pbIntervalFinished = new bool[m_nMaxDepth+1]; + m_pnPreParentCount[0] = 0; + m_pbIntervalFinished[0] = false; + double fParentValue = _getTickValue(0,0); + for( nDepth = 1; nDepth<=m_nMaxDepth ;nDepth++ ) + { + m_pbIntervalFinished[nDepth] = false; + + sal_Int32 nPreParentCount = 0; + sal_Int32 nCount = _getTickCount(nDepth); + for(sal_Int32 nN = 0; nN<nCount; nN++) + { + if(_getTickValue(nDepth,nN) < fParentValue) + nPreParentCount++; + else + break; + } + m_pnPreParentCount[nDepth] = nPreParentCount; + if(nCount) + { + double fNextParentValue = _getTickValue(nDepth,0); + if( fNextParentValue < fParentValue ) + fParentValue = fNextParentValue; + } + } +} + +TickIter::~TickIter() +{ + delete[] m_pnPositions; + delete[] m_pnPreParentCount; + delete[] m_pbIntervalFinished; +} + +sal_Int32 TickIter::getStartDepth() const +{ + //find the depth of the first visible tickmark: + //it is the depth of the smallest value + sal_Int32 nReturnDepth=0; + double fMinValue = DBL_MAX; + for(sal_Int32 nDepth = 0; nDepth<=m_nMaxDepth ;nDepth++ ) + { + sal_Int32 nCount = _getTickCount(nDepth); + if( !nCount ) + continue; + double fThisValue = _getTickValue(nDepth,0); + if(fThisValue<fMinValue) + { + nReturnDepth = nDepth; + fMinValue = fThisValue; + } + } + return nReturnDepth; +} + +double* TickIter::firstValue() +{ + if( gotoFirst() ) + { + m_fCurrentValue = _getTickValue(m_nCurrentDepth, m_pnPositions[m_nCurrentDepth]); + return &m_fCurrentValue; + } + return NULL; +} + +TickInfo* TickIter::firstInfo() +{ + if( m_pInfoTicks && gotoFirst() ) + return &(*m_pInfoTicks)[m_nCurrentDepth][m_pnPositions[m_nCurrentDepth]]; + return NULL; +} + +sal_Int32 TickIter::getIntervalCount( sal_Int32 nDepth ) +{ + if(nDepth>m_rIncrement.SubIncrements.getLength() || nDepth<0) + return 0; + + if(!nDepth) + return m_nTickCount; + + return m_rIncrement.SubIncrements[nDepth-1].IntervalCount; +} + +bool TickIter::isAtLastPartTick() +{ + if(!m_nCurrentDepth) + return false; + sal_Int32 nIntervalCount = getIntervalCount( m_nCurrentDepth ); + if(!nIntervalCount || nIntervalCount == 1) + return true; + if( m_pbIntervalFinished[m_nCurrentDepth] ) + return false; + sal_Int32 nPos = m_pnPositions[m_nCurrentDepth]+1; + if(m_pnPreParentCount[m_nCurrentDepth]) + nPos += nIntervalCount-1 - m_pnPreParentCount[m_nCurrentDepth]; + bool bRet = nPos && nPos % (nIntervalCount-1) == 0; + if(!nPos && !m_pnPreParentCount[m_nCurrentDepth] + && m_pnPositions[m_nCurrentDepth-1]==-1 ) + bRet = true; + return bRet; +} + +bool TickIter::gotoFirst() +{ + if( m_nMaxDepth<0 ) + return false; + if( !m_nTickCount ) + return false; + + for(sal_Int32 nDepth = 0; nDepth<=m_nMaxDepth ;nDepth++ ) + m_pnPositions[nDepth] = -1; + + m_nCurrentPos = 0; + m_nCurrentDepth = getStartDepth(); + m_pnPositions[m_nCurrentDepth] = 0; + return true; +} + +bool TickIter::gotoNext() +{ + if( m_nCurrentPos < 0 ) + return false; + m_nCurrentPos++; + + if( m_nCurrentPos >= m_nTickCount ) + return false; + + if( m_nCurrentDepth==m_nMaxDepth && isAtLastPartTick() ) + { + do + { + m_pbIntervalFinished[m_nCurrentDepth] = true; + m_nCurrentDepth--; + } + while( m_nCurrentDepth && isAtLastPartTick() ); + } + else if( m_nCurrentDepth<m_nMaxDepth ) + { + do + { + m_nCurrentDepth++; + } + while( m_nCurrentDepth<m_nMaxDepth ); + } + m_pbIntervalFinished[m_nCurrentDepth] = false; + m_pnPositions[m_nCurrentDepth] = m_pnPositions[m_nCurrentDepth]+1; + return true; +} + +double* TickIter::nextValue() +{ + if( gotoNext() ) + { + m_fCurrentValue = _getTickValue(m_nCurrentDepth, m_pnPositions[m_nCurrentDepth]); + return &m_fCurrentValue; + } + return NULL; +} + +TickInfo* TickIter::nextInfo() +{ + if( m_pInfoTicks && gotoNext() ) + return &(*m_pInfoTicks)[m_nCurrentDepth][m_pnPositions[m_nCurrentDepth]]; + return NULL; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +//static +double TickmarkHelper::getMinimumAtIncrement( double fMin, const ExplicitIncrementData& rIncrement ) +{ + //the returned value will be <= fMin and on a Major Tick given by rIncrement + if(rIncrement.Distance<=0.0) + return fMin; + + double fRet = rIncrement.BaseValue + + static_cast<sal_Int32>( + approxSub( fMin, rIncrement.BaseValue ) + / rIncrement.Distance) + *rIncrement.Distance; + + if( fRet > fMin ) + { + if( !approxEqual(fRet, fMin) ) + fRet -= rIncrement.Distance; + } + return fRet; +} +//static +double TickmarkHelper::getMaximumAtIncrement( double fMax, const ExplicitIncrementData& rIncrement ) +{ + //the returned value will be >= fMax and on a Major Tick given by rIncrement + if(rIncrement.Distance<=0.0) + return fMax; + + double fRet = rIncrement.BaseValue + + static_cast<sal_Int32>( + approxSub( fMax, rIncrement.BaseValue ) + / rIncrement.Distance) + *rIncrement.Distance; + + if( fRet < fMax ) + { + if( !approxEqual(fRet, fMax) ) + fRet += rIncrement.Distance; + } + return fRet; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +TickmarkHelper::TickmarkHelper( + const ExplicitScaleData& rScale, const ExplicitIncrementData& rIncrement ) + : m_rScale( rScale ) + , m_rIncrement( rIncrement ) + , m_xInverseScaling(NULL) + , m_pfCurrentValues(NULL) +{ + //@todo: make sure that the scale is valid for the scaling + + m_pfCurrentValues = new double[getTickDepth()]; + + if( m_rScale.Scaling.is() ) + { + m_xInverseScaling = m_rScale.Scaling->getInverseScaling(); + DBG_ASSERT( m_xInverseScaling.is(), "each Scaling needs to return a inverse Scaling" ); + } + + double fMin = m_fScaledVisibleMin = m_rScale.Minimum; + if( m_xInverseScaling.is() ) + { + m_fScaledVisibleMin = m_rScale.Scaling->doScaling(m_fScaledVisibleMin); + if(m_rIncrement.PostEquidistant ) + fMin = m_fScaledVisibleMin; + } + + double fMax = m_fScaledVisibleMax = m_rScale.Maximum; + if( m_xInverseScaling.is() ) + { + m_fScaledVisibleMax = m_rScale.Scaling->doScaling(m_fScaledVisibleMax); + if(m_rIncrement.PostEquidistant ) + fMax = m_fScaledVisibleMax; + } + + //-- + m_fOuterMajorTickBorderMin = TickmarkHelper::getMinimumAtIncrement( fMin, m_rIncrement ); + m_fOuterMajorTickBorderMax = TickmarkHelper::getMaximumAtIncrement( fMax, m_rIncrement ); + //-- + + m_fOuterMajorTickBorderMin_Scaled = m_fOuterMajorTickBorderMin; + m_fOuterMajorTickBorderMax_Scaled = m_fOuterMajorTickBorderMax; + if(!m_rIncrement.PostEquidistant && m_xInverseScaling.is() ) + { + m_fOuterMajorTickBorderMin_Scaled = m_rScale.Scaling->doScaling(m_fOuterMajorTickBorderMin); + m_fOuterMajorTickBorderMax_Scaled = m_rScale.Scaling->doScaling(m_fOuterMajorTickBorderMax); + + //check validity of new range: m_fOuterMajorTickBorderMin <-> m_fOuterMajorTickBorderMax + //it is assumed here, that the original range in the given Scale is valid + if( !rtl::math::isFinite(m_fOuterMajorTickBorderMin_Scaled) ) + { + m_fOuterMajorTickBorderMin += m_rIncrement.Distance; + m_fOuterMajorTickBorderMin_Scaled = m_rScale.Scaling->doScaling(m_fOuterMajorTickBorderMin); + } + if( !rtl::math::isFinite(m_fOuterMajorTickBorderMax_Scaled) ) + { + m_fOuterMajorTickBorderMax -= m_rIncrement.Distance; + m_fOuterMajorTickBorderMax_Scaled = m_rScale.Scaling->doScaling(m_fOuterMajorTickBorderMax); + } + } +} + +TickmarkHelper::~TickmarkHelper() +{ + delete[] m_pfCurrentValues; +} + +sal_Int32 TickmarkHelper::getTickDepth() const +{ + return m_rIncrement.SubIncrements.getLength() + 1; +} + +sal_Int32 TickmarkHelper::getMaxTickCount( sal_Int32 nDepth ) const +{ + //return the maximum amount of ticks + //possibly open intervals at the two ends of the region are handled as if they were completely visible + //(this is necessary for calculating the sub ticks at the borders correctly) + + if( nDepth >= getTickDepth() ) + return 0; + if( m_fOuterMajorTickBorderMax < m_fOuterMajorTickBorderMin ) + return 0; + + sal_Int32 nIntervalCount; + if(m_rIncrement.PostEquidistant ) + nIntervalCount = static_cast<sal_Int32> + ( approxSub( m_fScaledVisibleMax, m_fScaledVisibleMin ) + / m_rIncrement.Distance ); + else + nIntervalCount = static_cast<sal_Int32> + ( approxSub( m_rScale.Maximum, m_rScale.Minimum ) + / m_rIncrement.Distance ); + nIntervalCount+=3; + for(sal_Int32 nN=0; nN<nDepth-1; nN++) + { + if( m_rIncrement.SubIncrements[nN].IntervalCount>1 ) + nIntervalCount *= m_rIncrement.SubIncrements[nN].IntervalCount; + } + + sal_Int32 nTickCount = nIntervalCount; + if(nDepth>0 && m_rIncrement.SubIncrements[nDepth-1].IntervalCount>1) + nTickCount = nIntervalCount * (m_rIncrement.SubIncrements[nDepth-1].IntervalCount-1); + + return nTickCount; +} + +double* TickmarkHelper::getMajorTick( sal_Int32 nTick ) const +{ + m_pfCurrentValues[0] = m_fOuterMajorTickBorderMin + nTick*m_rIncrement.Distance; + + if(m_pfCurrentValues[0]>m_fOuterMajorTickBorderMax) + return NULL; + if(m_pfCurrentValues[0]<m_fOuterMajorTickBorderMin) + return NULL; + + //return always the value after scaling + if(!m_rIncrement.PostEquidistant && m_xInverseScaling.is() ) + m_pfCurrentValues[0] = m_rScale.Scaling->doScaling( m_pfCurrentValues[0] ); + + return &m_pfCurrentValues[0]; +} + +double* TickmarkHelper::getMinorTick( sal_Int32 nTick, sal_Int32 nDepth + , double fStartParentTick, double fNextParentTick ) const +{ + //check validity of arguments + { + //DBG_ASSERT( fStartParentTick < fNextParentTick, "fStartParentTick >= fNextParentTick"); + if(fStartParentTick >= fNextParentTick) + return NULL; + if(nDepth>m_rIncrement.SubIncrements.getLength() || nDepth<=0) + return NULL; + + //subticks are only calculated if they are laying between parent ticks: + if(nTick<=0) + return NULL; + if(nTick>=m_rIncrement.SubIncrements[nDepth-1].IntervalCount) + return NULL; + } + + bool bPostEquidistant = m_rIncrement.SubIncrements[nDepth-1].PostEquidistant; + + double fAdaptedStartParent = fStartParentTick; + double fAdaptedNextParent = fNextParentTick; + + if( !bPostEquidistant && m_xInverseScaling.is() ) + { + fAdaptedStartParent = m_xInverseScaling->doScaling(fStartParentTick); + fAdaptedNextParent = m_xInverseScaling->doScaling(fNextParentTick); + } + + double fDistance = (fAdaptedNextParent - fAdaptedStartParent)/m_rIncrement.SubIncrements[nDepth-1].IntervalCount; + + m_pfCurrentValues[nDepth] = fAdaptedStartParent + nTick*fDistance; + double& fTest = m_pfCurrentValues[nDepth]; + + //return always the value after scaling + if(!bPostEquidistant && m_xInverseScaling.is() ) + m_pfCurrentValues[nDepth] = m_rScale.Scaling->doScaling( m_pfCurrentValues[nDepth] ); + + if( !isWithinOuterBorder( m_pfCurrentValues[nDepth] ) ) + return NULL; + + return &m_pfCurrentValues[nDepth]; +} + +bool TickmarkHelper::isWithinOuterBorder( double fScaledValue ) const +{ + if(fScaledValue>m_fOuterMajorTickBorderMax_Scaled) + return false; + if(fScaledValue<m_fOuterMajorTickBorderMin_Scaled) + return false; + + return true; +} + + +bool TickmarkHelper::isVisible( double fScaledValue ) const +{ + if(fScaledValue>m_fScaledVisibleMax) + return false; + if(fScaledValue<m_fScaledVisibleMin) + return false; + + return true; +} + +bool TickmarkHelper::isPostEquidistant( sal_Int32 nDepth ) const +{ + if( nDepth<0 || nDepth>m_rIncrement.SubIncrements.getLength() ) + { + DBG_ERROR("invalid depth for tickmark"); + return true; + } + + if( nDepth==0 ) + return m_rIncrement.PostEquidistant; + + return m_rIncrement.SubIncrements[nDepth-1].PostEquidistant; +} + +void TickmarkHelper::getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const +{ + uno::Sequence< uno::Sequence< double > > aAllTicks; + + //create point sequences for each tick depth + sal_Int32 nDepthCount = this->getTickDepth(); + sal_Int32 nMaxMajorTickCount = this->getMaxTickCount( 0 ); + + aAllTicks.realloc(nDepthCount); + aAllTicks[0].realloc(nMaxMajorTickCount); + + sal_Int32 nRealMajorTickCount = 0; + double* pValue = NULL; + for( sal_Int32 nMajorTick=0; nMajorTick<nMaxMajorTickCount; nMajorTick++ ) + { + pValue = this->getMajorTick( nMajorTick ); + if(!pValue) + continue; + aAllTicks[0][nRealMajorTickCount] = *pValue; + nRealMajorTickCount++; + } + if(!nRealMajorTickCount) + return; + aAllTicks[0].realloc(nRealMajorTickCount); + + if(nDepthCount>0) + this->addSubTicks( 1, aAllTicks ); + + //so far we have added all ticks between the outer major tick marks + //this was necessary to create sub ticks correctly + //now we reduce all ticks to the visible ones that lie between the real borders + sal_Int32 nDepth = 0; + for( nDepth = 0; nDepth < nDepthCount; nDepth++) + { + sal_Int32 nInvisibleAtLowerBorder = 0; + sal_Int32 nInvisibleAtUpperBorder = 0; + //we need only to check all ticks within the first major interval at each border + sal_Int32 nCheckCount = 1; + for(sal_Int32 nN=0; nN<nDepth; nN++) + { + if( m_rIncrement.SubIncrements[nN].IntervalCount>1 ) + nCheckCount *= m_rIncrement.SubIncrements[nN].IntervalCount; + } + uno::Sequence< double >& rTicks = aAllTicks[nDepth]; + sal_Int32 nCount = rTicks.getLength(); + //check lower border + for( sal_Int32 nTick=0; nTick<nCheckCount && nTick<nCount; nTick++) + { + if( !isVisible( rTicks[nTick] ) ) + nInvisibleAtLowerBorder++; + } + //check upper border + for( nTick=nCount-1; nTick>nCount-1-nCheckCount && nTick>=0; nTick--) + { + if( !isVisible( rTicks[nTick] ) ) + nInvisibleAtUpperBorder++; + } + //resize sequence + if( !nInvisibleAtLowerBorder && !nInvisibleAtUpperBorder) + continue; + if( !nInvisibleAtLowerBorder ) + rTicks.realloc(nCount-nInvisibleAtUpperBorder); + else + { + sal_Int32 nNewCount = nCount-nInvisibleAtUpperBorder-nInvisibleAtLowerBorder; + if(nNewCount<0) + nNewCount=0; + + uno::Sequence< double > aOldTicks(rTicks); + rTicks.realloc(nNewCount); + for(sal_Int32 nTick = 0; nTick<nNewCount; nTick++) + rTicks[nTick] = aOldTicks[nInvisibleAtLowerBorder+nTick]; + } + } + + //fill return value + rAllTickInfos.resize(aAllTicks.getLength()); + for( nDepth=0 ;nDepth<aAllTicks.getLength(); nDepth++ ) + { + sal_Int32 nCount = aAllTicks[nDepth].getLength(); + rAllTickInfos[nDepth].resize( nCount ); + for(sal_Int32 nN = 0; nN<nCount; nN++) + { + rAllTickInfos[nDepth][nN].fScaledTickValue = aAllTicks[nDepth][nN]; + } + } + + //----------------------------------------- + //get the transformed screen values for all tickmarks in aAllTickInfos + this->updateScreenValues( rAllTickInfos ); + + //----------------------------------------- + //'hide' tickmarks with identical screen values in aAllTickInfos + this->hideIdenticalScreenValues( rAllTickInfos ); +} + +void TickmarkHelper::addSubTicks( sal_Int32 nDepth, uno::Sequence< uno::Sequence< double > >& rParentTicks ) const +{ + TickIter aIter( rParentTicks, m_rIncrement, 0, nDepth-1 ); + double* pfNextParentTick = aIter.firstValue(); + if(!pfNextParentTick) + return; + double fLastParentTick = *pfNextParentTick; + pfNextParentTick = aIter.nextValue(); + if(!pfNextParentTick) + return; + + sal_Int32 nMaxSubTickCount = this->getMaxTickCount( nDepth ); + if(!nMaxSubTickCount) + return; + + uno::Sequence< double > aSubTicks(nMaxSubTickCount); + sal_Int32 nRealSubTickCount = 0; + sal_Int32 nIntervalCount = m_rIncrement.SubIncrements[nDepth-1].IntervalCount; + + double* pValue = NULL; + for(; pfNextParentTick; fLastParentTick=*pfNextParentTick, pfNextParentTick = aIter.nextValue()) + { + for( sal_Int32 nPartTick = 1; nPartTick<nIntervalCount; nPartTick++ ) + { + pValue = this->getMinorTick( nPartTick, nDepth + , fLastParentTick, *pfNextParentTick ); + if(!pValue) + continue; + + aSubTicks[nRealSubTickCount] = *pValue; + nRealSubTickCount++; + } + } + + aSubTicks.realloc(nRealSubTickCount); + rParentTicks[nDepth] = aSubTicks; + if(m_rIncrement.SubIncrements.getLength()>nDepth) + addSubTicks( nDepth+1, rParentTicks ); +} + +//----------------------------------------------------------------------------- +// ___TickmarkHelper_3D___ +//----------------------------------------------------------------------------- +TickmarkHelper_2D::TickmarkHelper_2D( + const ExplicitScaleData& rScale, const ExplicitIncrementData& rIncrement + , double fStrech_SceneToScreen, double fOffset_SceneToScreen ) + : TickmarkHelper( rScale, rIncrement ) + , m_fStrech_LogicToScreen(1.0) + , m_fOffset_LogicToScreen(0.0) +{ + double fWidthY = m_fScaledVisibleMax - m_fScaledVisibleMin; + m_fStrech_LogicToScreen = FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthY * fStrech_SceneToScreen; + m_fOffset_LogicToScreen = -m_fScaledVisibleMin*m_fStrech_LogicToScreen + fOffset_SceneToScreen; +} + +TickmarkHelper_2D::~TickmarkHelper_2D() +{ +} + +sal_Int32 TickmarkHelper_2D::transformScaledLogicTickToScreen( double fValue ) const +{ + sal_Int32 nRet = static_cast<sal_Int32>( + fValue*m_fStrech_LogicToScreen + m_fOffset_LogicToScreen); + return nRet; +} + +//static +sal_Int32 TickmarkHelper_2D::getTickScreenDistance( TickIter& rIter ) +{ + //return the positive distance between the two first tickmarks in screen values + //if there are less than two tickmarks -1 is returned + + const TickInfo* pFirstTickInfo = rIter.firstInfo(); + const TickInfo* pSecondTickInfo = rIter.nextInfo(); + if(!pSecondTickInfo || !pFirstTickInfo) + return -1; + + sal_Int32 nRet = pSecondTickInfo->nScreenTickValue - pFirstTickInfo->nScreenTickValue; + if(nRet<0) + nRet *= -1; + return nRet; +} + +sal_Int32 TickmarkHelper_2D::getScreenValueForMinimum() const +{ + //return the screen value at the end of the axis where the scale has its minimum + //(lower end of axis line) + return this->transformScaledLogicTickToScreen( + m_fScaledVisibleMin ); +} + +sal_Int32 TickmarkHelper_2D::getScreenValueForMaximum() const +{ + //return the screen value at the end of the axis where the scale has its maximum + //(upper end of axis line) + return this->transformScaledLogicTickToScreen( + m_fScaledVisibleMax ); +} + +void TickmarkHelper_2D::updateScreenValues( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const +{ + //get the transformed screen values for all tickmarks in rAllTickInfos + ::std::vector< ::std::vector< TickInfo > >::iterator aDepthIter = rAllTickInfos.begin(); + const ::std::vector< ::std::vector< TickInfo > >::const_iterator aDepthEnd = rAllTickInfos.end(); + for( ; aDepthIter != aDepthEnd; aDepthIter++ ) + { + ::std::vector< TickInfo >::iterator aTickIter = (*aDepthIter).begin(); + const ::std::vector< TickInfo >::const_iterator aTickEnd = (*aDepthIter).end(); + for( ; aTickIter != aTickEnd; aTickIter++ ) + { + TickInfo& rTickInfo = (*aTickIter); + rTickInfo.nScreenTickValue = + this->transformScaledLogicTickToScreen( + rTickInfo.fScaledTickValue ); + } + } +} + +//'hide' tickmarks with identical screen values in aAllTickInfos +void TickmarkHelper_2D::hideIdenticalScreenValues( + ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const +{ + TickIter aIter( rAllTickInfos, m_rIncrement ); + + TickInfo* pPreviousTickInfo = aIter.firstInfo(); + if(!pPreviousTickInfo) + return; + pPreviousTickInfo->bPaintIt = true; + for( TickInfo* pTickInfo = aIter.nextInfo(); pTickInfo; pTickInfo = aIter.nextInfo()) + { + pTickInfo->bPaintIt = pTickInfo->nScreenTickValue != pPreviousTickInfo->nScreenTickValue; + pPreviousTickInfo = pTickInfo; + } +} +//----------------------------------------------------------------------------- +// ___TickmarkHelper_3D___ +//----------------------------------------------------------------------------- +TickmarkHelper_3D::TickmarkHelper_3D( + const ExplicitScaleData& rScale, const ExplicitIncrementData& rIncrement ) + : TickmarkHelper( rScale, rIncrement ) +{ +} + +TickmarkHelper_3D::~TickmarkHelper_3D() +{ +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/axes/TickmarkHelper.hxx b/chart2/source/view/axes/TickmarkHelper.hxx new file mode 100644 index 000000000000..1462cc8dcb5c --- /dev/null +++ b/chart2/source/view/axes/TickmarkHelper.hxx @@ -0,0 +1,265 @@ +/************************************************************************* + * + * $RCSfile: TickmarkHelper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_TICKMARKHELPER_HXX +#define _CHART2_TICKMARKHELPER_HXX + +#include <vector> + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_EXPLICITINCREMENTDATA_HPP_ +#include <drafts/com/sun/star/chart2/ExplicitIncrementData.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_EXPLICITSCALEDATA_HPP_ +#include <drafts/com/sun/star/chart2/ExplicitScaleData.hpp> +#endif + +#ifndef _COM_SUN_STAR_DRAWING_XSHAPE_HPP_ +#include <com/sun/star/drawing/XShape.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_H_ +#include <com/sun/star/uno/Sequence.h> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +struct TickInfo +{ + double fScaledTickValue; + double fUnscaledTickValue; + + sal_Int32 nScreenTickValue; + + bool bPaintIt; + + ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShape > xTextShape; + +//methods: + TickInfo(); + void updateUnscaledValue( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XScaling >& xInverseScaling ); +}; + +class TickIter +{ +public: + TickIter( const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< double > >& rTicks + , const ::drafts::com::sun::star::chart2::ExplicitIncrementData& rIncrement + , sal_Int32 nMinDepth=0, sal_Int32 nMaxDepth=-1 ); + TickIter( ::std::vector< ::std::vector< TickInfo > >& rTickInfos + , const ::drafts::com::sun::star::chart2::ExplicitIncrementData& rIncrement + , sal_Int32 nMinDepth=0, sal_Int32 nMaxDepth=-1 ); + virtual ~TickIter(); + + double* firstValue(); + double* nextValue(); + + TickInfo* firstInfo(); + TickInfo* nextInfo(); + + sal_Int32 getCurrentDepth() const { return m_nCurrentDepth; } + +private: //methods + sal_Int32 getIntervalCount( sal_Int32 nDepth ); + bool isAtLastPartTick(); + + void initIter( sal_Int32 nMinDepth, sal_Int32 nMaxDepth ); + sal_Int32 getStartDepth() const; + + bool gotoFirst(); + bool gotoNext(); + + + double _getTickValue(sal_Int32 nDepth, sal_Int32 nIndex) const + { + if(m_pSimpleTicks) + return (*m_pSimpleTicks)[nDepth][nIndex]; + else + return (((*m_pInfoTicks)[nDepth])[nIndex]).fScaledTickValue; + } + sal_Int32 _getTickCount( sal_Int32 nDepth ) const + { + if(m_pSimpleTicks) + return (*m_pSimpleTicks)[nDepth].getLength(); + else + return (*m_pInfoTicks)[nDepth].size(); + } + sal_Int32 _getMaxDepth() const + { + if(m_pSimpleTicks) + return (*m_pSimpleTicks).getLength()-1; + else + return (*m_pInfoTicks).size()-1; + } + +private: //member + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< double > >* m_pSimpleTicks; + ::std::vector< ::std::vector< TickInfo > >* m_pInfoTicks; + const ::drafts::com::sun::star::chart2::ExplicitIncrementData& m_rIncrement; + //iteration from m_nMinDepth to m_nMaxDepth + sal_Int32 m_nMinDepth; + sal_Int32 m_nMaxDepth; + sal_Int32 m_nTickCount; + sal_Int32* m_pnPositions; //current positions in the different sequences + sal_Int32* m_pnPreParentCount; //the tickmarks do not start with a major tick always, + //the PreParentCount states for each depth how many subtickmarks are available in front of the first parent tickmark + bool* m_pbIntervalFinished; + sal_Int32 m_nCurrentDepth; + sal_Int32 m_nCurrentPos; + double m_fCurrentValue; +}; + +class TickmarkHelper +{ +public: + TickmarkHelper( + const ::drafts::com::sun::star::chart2::ExplicitScaleData& rScale + , const ::drafts::com::sun::star::chart2::ExplicitIncrementData& rIncrement ); + virtual ~TickmarkHelper(); + + void getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const; + bool isPostEquidistant( sal_Int32 nDepth ) const; + + // + static double getMinimumAtIncrement( double fMin, const ::drafts::com::sun::star::chart2::ExplicitIncrementData& rIncrement ); + static double getMaximumAtIncrement( double fMax, const ::drafts::com::sun::star::chart2::ExplicitIncrementData& rIncrement ); + +protected: //methods + void addSubTicks( sal_Int32 nDepth, + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< double > >& rParentTicks ) const; + double* getMajorTick( sal_Int32 nTick ) const; + double* getMinorTick( sal_Int32 nTick, sal_Int32 nDepth + , double fStartParentTick, double fNextParentTick ) const; + sal_Int32 getMaxTickCount( sal_Int32 nDepth = 0 ) const; + sal_Int32 getTickDepth() const; + bool isVisible( double fValue ) const; + bool isWithinOuterBorder( double fScaledValue ) const; //all within the outer major tick marks + + virtual void updateScreenValues( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const {} + virtual void hideIdenticalScreenValues( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const {} + +protected: //member + const ::drafts::com::sun::star::chart2::ExplicitScaleData& m_rScale; + const ::drafts::com::sun::star::chart2::ExplicitIncrementData& m_rIncrement; + + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XScaling > + m_xInverseScaling; + double* m_pfCurrentValues; + //major-tick positions that may lay outside the visible range but complete partly visible intervals at the borders + double m_fOuterMajorTickBorderMin; + double m_fOuterMajorTickBorderMax; + double m_fOuterMajorTickBorderMin_Scaled; + double m_fOuterMajorTickBorderMax_Scaled; + + //minimum and maximum of the visible range after scaling + double m_fScaledVisibleMin; + double m_fScaledVisibleMax; +}; + +class TickmarkHelper_2D : public TickmarkHelper +{ +public: + TickmarkHelper_2D( + const ::drafts::com::sun::star::chart2::ExplicitScaleData& rScale + , const ::drafts::com::sun::star::chart2::ExplicitIncrementData& rIncrement + , double fStrech_SceneToScreen, double fOffset_SceneToScreen ); + virtual ~TickmarkHelper_2D(); + + static sal_Int32 getTickScreenDistance( TickIter& rIter ); + + //methods more for axis line + sal_Int32 getScreenValueForMinimum() const; + sal_Int32 getScreenValueForMaximum() const; + +protected: //methods + virtual void updateScreenValues( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const; + virtual void hideIdenticalScreenValues( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) const; + + sal_Int32 transformScaledLogicTickToScreen( double fValue ) const; + +private: //member + double m_fStrech_LogicToScreen; + double m_fOffset_LogicToScreen; +}; + +class TickmarkHelper_3D : public TickmarkHelper +{ +public: + TickmarkHelper_3D( + const ::drafts::com::sun::star::chart2::ExplicitScaleData& rScale + , const ::drafts::com::sun::star::chart2::ExplicitIncrementData& rIncrement ); + virtual ~TickmarkHelper_3D(); + +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx new file mode 100644 index 000000000000..b94493b16524 --- /dev/null +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -0,0 +1,468 @@ +/************************************************************************* + * + * $RCSfile: VAxisProperties.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "VAxisProperties.hxx" +#include "macros.hxx" +#include "ViewDefines.hxx" +#include "CommonConverters.hxx" + +#ifndef _TOOLS_COLOR_HXX +#include <tools/color.hxx> +#endif + +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +#ifndef _COM_SUN_STAR_CHART_CHARTAXISARRANGEORDERTYPE_HPP_ +#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_LINESTYLE_HPP_ +#include <com/sun/star/drawing/LineStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_TEXT_WRITINGMODE2_HPP_ +#include <com/sun/star/text/WritingMode2.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +sal_Int32 AxisProperties::calcTickLengthForDepth(sal_Int32 nDepth,sal_Int32 nTickmarkStyle) const +{ + sal_Int32 nWidth = AXIS2D_TICKLENGTH; //@maybefuturetodo this length could be offered by the model + double fPercent = 1.0; + switch(nDepth) + { + case 0: + fPercent = 1.0; + break; + case 1: + fPercent = 0.75;//percentage like in the old chart + break; + case 2: + fPercent = 0.5; + break; + default: + fPercent = 0.3; + break; + } + if(nTickmarkStyle==3)//inner and outer tickmarks + fPercent*=2.0; + return static_cast<sal_Int32>(nWidth*fPercent); +} + +sal_Int32 getTickOffset(sal_Int32 nLength,sal_Int32 nTickmarkStyle) +{ + double fPercent = 0.0; //0<=fPercent<=1 + //0.0: completly inner + //1.0: completly outer + //0.5: half and half + + /* + nTickmarkStyle: + 1: inner tickmarks + 2: outer tickmarks + 3: inner and outer tickmarks + */ + switch(nTickmarkStyle) + { + case 1: + fPercent = 0.0; + break; + case 2: + fPercent = 1.0; + break; + default: + fPercent = 0.5; + break; + } + return static_cast<sal_Int32>(fPercent*nLength); +} + +LineProperties AxisProperties::makeLinePropertiesForDepth( sal_Int32 nDepth ) const +{ + //@todo get this from somewhere; maybe for each subincrement + //so far the model does not offer different settings for each tick depth + return m_aLineProperties; +} + +TickmarkProperties AxisProperties::makeTickmarkProperties( + sal_Int32 nDepth ) const +{ + /* + nTickmarkStyle: + 1: inner tickmarks + 2: outer tickmarks + 3: inner and outer tickmarks + */ + sal_Int32 nTickmarkStyle = 1; + if(nDepth==0) + { + nTickmarkStyle = m_nMajorTickmarks; + if(!nTickmarkStyle) + { + //create major tickmarks as if they were minor tickmarks + nDepth = 1; + nTickmarkStyle = m_nMinorTickmarks; + } + } + else if( nDepth==1) + { + nTickmarkStyle = m_nMinorTickmarks; + } + + TickmarkProperties aTickmarkProperties; + aTickmarkProperties.Length = this->calcTickLengthForDepth(nDepth,nTickmarkStyle); + + sal_Int32 nSign = m_bIsLeftOrBottomAxis ? 1 : -1; + if(m_bIsYAxis) + nSign *= -1; + aTickmarkProperties.RelativePos = nSign*getTickOffset(aTickmarkProperties.Length,nTickmarkStyle); + aTickmarkProperties.Length *= -nSign; + aTickmarkProperties.aLineProperties = this->makeLinePropertiesForDepth( nDepth ); + return aTickmarkProperties; +} + +//-------------------------------------------------------------------------- + +AxisProperties::AxisProperties() + : m_xAxisModel(NULL) + , m_bIsYAxis(true) + , m_bIsLeftOrBottomAxis(true) + , m_pfMainLinePositionAtOtherAxis(NULL) + , m_pfExrtaLinePositionAtOtherAxis(NULL) + /* + , m_nOrthogonalAxisScreenPosition(0) + , m_nOrthogonalAxisExtraLineScreenPosition(0) + */ + , m_eRelativeLabelPosition(LEFTORBOTTOM_OF_AXIS) + , m_nMajorTickmarks(1) + , m_nMinorTickmarks(1) + , m_aTickmarkPropertiesList() + , m_aLineProperties() + , m_bTESTTEST_HorizontalAdjustmentIsLeft(true) +{ +} + +AxisProperties::AxisProperties( const AxisProperties& rAxisProperties ) + : m_xAxisModel( rAxisProperties.m_xAxisModel ) + , m_bIsYAxis( rAxisProperties.m_bIsYAxis ) + , m_bIsLeftOrBottomAxis( rAxisProperties.m_bIsLeftOrBottomAxis ) + , m_pfMainLinePositionAtOtherAxis( NULL ) + , m_pfExrtaLinePositionAtOtherAxis( NULL ) + , m_eRelativeLabelPosition( rAxisProperties.m_eRelativeLabelPosition ) + , m_nMajorTickmarks( rAxisProperties.m_nMajorTickmarks ) + , m_nMinorTickmarks( rAxisProperties.m_nMinorTickmarks ) + , m_aTickmarkPropertiesList( rAxisProperties.m_aTickmarkPropertiesList ) + , m_aLineProperties( rAxisProperties.m_aLineProperties ) + , m_bTESTTEST_HorizontalAdjustmentIsLeft( rAxisProperties.m_bTESTTEST_HorizontalAdjustmentIsLeft ) +{ + if( rAxisProperties.m_pfMainLinePositionAtOtherAxis ) + m_pfMainLinePositionAtOtherAxis = new double(*rAxisProperties.m_pfMainLinePositionAtOtherAxis); + if( rAxisProperties.m_pfExrtaLinePositionAtOtherAxis ) + m_pfExrtaLinePositionAtOtherAxis = new double (*rAxisProperties.m_pfExrtaLinePositionAtOtherAxis); +} + +AxisProperties::~AxisProperties() +{ + delete m_pfMainLinePositionAtOtherAxis; + delete m_pfExrtaLinePositionAtOtherAxis; +} + +void AxisProperties::init() +{ + if( !m_xAxisModel.is() ) + return; + sal_Int32 nDimension = m_xAxisModel->getRepresentedDimension(); + m_bIsYAxis = (nDimension==1); + + //init LineProperties + m_aLineProperties.initFromPropertySet( uno::Reference<beans::XPropertySet>::query( m_xAxisModel ) ); + + //init TickmarkProperties + uno::Reference< beans::XPropertySet > xProp = + uno::Reference<beans::XPropertySet>::query( this->m_xAxisModel ); + if(xProp.is()) + { + try + { + xProp->getPropertyValue( C2U( "MajorTickmarks" ) ) >>= m_nMajorTickmarks; + xProp->getPropertyValue( C2U( "MinorTickmarks" ) ) >>= m_nMinorTickmarks; + + sal_Int32 nMaxDepth = 0; + if(m_nMinorTickmarks!=0) + nMaxDepth=2; + else if(m_nMajorTickmarks!=0) + nMaxDepth=1; + + this->m_aTickmarkPropertiesList.clear(); + for( sal_Int32 nDepth=0; nDepth<nMaxDepth; nDepth++ ) + { + TickmarkProperties aTickmarkProperties = this->makeTickmarkProperties( nDepth ); + this->m_aTickmarkPropertiesList.push_back( aTickmarkProperties ); + } + } + catch( uno::Exception& e ) + { + e; + } + } +} + +sal_Int32 getAxisScreenPosition( double fCrossOtherAxis + , const PlottingPositionHelper& rPosHelper, bool bIsYAxis ) +{ + double fX = bIsYAxis ? fCrossOtherAxis : rPosHelper.getLogicMinX(); + double fY = bIsYAxis ? rPosHelper.getLogicMinY() : fCrossOtherAxis; + + rPosHelper.clipLogicValues( &fX,&fY,0 ); + rPosHelper.doLogicScaling( &fX,&fY,0 ); + drawing::Position3D aPos( fX, fY, 0); + + uno::Reference< XTransformation > xTransformation = + rPosHelper.getTransformationLogicToScene(); + uno::Sequence< double > aSeq = + xTransformation->transform( Position3DToSequence(aPos) ); + + return static_cast<sal_Int32>( + bIsYAxis ? aSeq[0] : aSeq[1] ); +} + + + +sal_Int32 AxisProperties::getMainLineScreenPosition( + const PlottingPositionHelper& rPosHelper ) const +{ + double fMin = m_bIsYAxis ? rPosHelper.getLogicMinX() : rPosHelper.getLogicMinY(); + double fMax = m_bIsYAxis ? rPosHelper.getLogicMaxX() : rPosHelper.getLogicMaxY(); + + double fCrossOtherAxis; + if(m_pfMainLinePositionAtOtherAxis) + fCrossOtherAxis = *m_pfMainLinePositionAtOtherAxis; + else + fCrossOtherAxis = m_bIsLeftOrBottomAxis ? fMin : fMax; + sal_Int32 nRet = getAxisScreenPosition( fCrossOtherAxis, rPosHelper, m_bIsYAxis ); + return nRet; +} + +bool AxisProperties::getExtraLineScreenPosition( + sal_Int32& rnExtraLineScreenPosition, const PlottingPositionHelper& rPosHelper ) const +{ + if( !m_pfExrtaLinePositionAtOtherAxis ) + return false; + + double fMin = m_bIsYAxis ? rPosHelper.getLogicMinX() : rPosHelper.getLogicMinY(); + double fMax = m_bIsYAxis ? rPosHelper.getLogicMaxX() : rPosHelper.getLogicMaxY(); + if( *m_pfExrtaLinePositionAtOtherAxis <= fMin + || *m_pfExrtaLinePositionAtOtherAxis >= fMax ) + return false; + rnExtraLineScreenPosition = getAxisScreenPosition( + *m_pfExrtaLinePositionAtOtherAxis, rPosHelper, m_bIsYAxis ); + return true; +} + +//----------------------------------------------------------------------------- + +AxisLabelProperties::AxisLabelProperties() + : aNumberFormat() + , bDisplayLabels( true ) + , eStaggering( SIDE_BY_SIDE ) + , bLineBreakAllowed( true ) + , bOverlapAllowed( false ) + , bStackCharacters( false ) + , fRotationAngleDegree( 0.0 ) + , nRhythm( 1 ) + , bRhythmIsFix(false) +{ + /* + aLocale.Language = C2U( "en" ); + aLocale.Country = C2U( "US" ); + + //aLocale.Language = C2U( "ar" ); + //aLocale.Country = C2U( "IR" ); + + //aLocale.Language = C2U( "ja" ); + //aLocale.Country = C2U( "JP" ); + */ +} + +void AxisLabelProperties::init( const uno::Reference< XAxis >& xAxisModel ) +{ + uno::Reference< beans::XPropertySet > xProp = + uno::Reference<beans::XPropertySet>::query( xAxisModel ); + if(xProp.is()) + { + try + { + if( !( xProp->getPropertyValue( C2U( "NumberFormat" ) ) >>= this->aNumberFormat ) ) + { + //@todo get number format from calc + } + + xProp->getPropertyValue( C2U( "DisplayLabels" ) ) >>= this->bDisplayLabels; + xProp->getPropertyValue( C2U( "TextBreak" ) ) >>= this->bLineBreakAllowed; + xProp->getPropertyValue( C2U( "TextOverlap" ) ) >>= this->bOverlapAllowed; + xProp->getPropertyValue( C2U( "StackCharacters" ) ) >>= this->bStackCharacters; + xProp->getPropertyValue( C2U( "TextRotation" ) ) >>= this->fRotationAngleDegree; + + ::com::sun::star::chart::ChartAxisArrangeOrderType eArrangeOrder; + xProp->getPropertyValue( C2U( "ArrangeOrder" ) ) >>= eArrangeOrder; + switch(eArrangeOrder) + { + case ::com::sun::star::chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE: + this->eStaggering = SIDE_BY_SIDE; + break; + case ::com::sun::star::chart::ChartAxisArrangeOrderType_STAGGER_EVEN: + this->eStaggering = STAGGER_EVEN; + break; + case ::com::sun::star::chart::ChartAxisArrangeOrderType_STAGGER_ODD: + this->eStaggering = STAGGER_ODD; + break; + default: + this->eStaggering = STAGGER_AUTO; + break; + } + } + catch( uno::Exception& e ) + { + e; + } + } +} + +/* +sal_Int16 getSwappedWritingMode( sal_Int16 nWritingMode ) +{ + //LR_TB == LT + //RL_TB == RT (Arabic, Hebrew) + //TB_RL == TR (Japanese, Chinese, Korean) + // ?? TL (Mongolian) see also text::WritingMode2 + + switch(nWritingMode) + { + case text::WritingMode2::RL_TB: + return text::WritingMode2::TB_RL; + case text::WritingMode2::TB_RL: + return text::WritingMode2::RL_TB; + case text::WritingMode2::LR_TB: + return text::WritingMode2::TB_LR; + default: + return text::WritingMode2::LR_TB; + } +} +*/ + +sal_Bool AxisLabelProperties::getIsStaggered() const +{ + if( STAGGER_ODD == eStaggering || STAGGER_EVEN == eStaggering ) + return sal_True; + return sal_False; +} + +//------------------------ + +drawing::TextVerticalAdjust AxisProperties::getVerticalAdjustment() const +{ + drawing::TextVerticalAdjust aRet = + !m_bIsYAxis && !m_bIsLeftOrBottomAxis + ? drawing::TextVerticalAdjust_BOTTOM + : drawing::TextVerticalAdjust_TOP; + return aRet; +} + +sal_Int16 AxisProperties::getWritingMode()const +{ + //@todo get this dependent on the locale ... + sal_Int16 nWritingMode( text::WritingMode2::LR_TB ); + return nWritingMode; +} + +drawing::TextHorizontalAdjust AxisProperties::getHorizontalAdjustment() const +{ + return m_bTESTTEST_HorizontalAdjustmentIsLeft + ? drawing::TextHorizontalAdjust_LEFT + : drawing::TextHorizontalAdjust_RIGHT; +// + + bool bIsYAxis = m_bIsYAxis; + bool bIsLeftOrBottomAxis = m_bIsLeftOrBottomAxis; + sal_Int16 nWritingMode = getWritingMode(); + + switch( nWritingMode ) + { + case text::WritingMode2::RL_TB: + case text::WritingMode2::TB_RL: + return bIsYAxis && !bIsLeftOrBottomAxis + ? drawing::TextHorizontalAdjust_LEFT + : drawing::TextHorizontalAdjust_RIGHT; + case text::WritingMode2::TB_LR: + default: + return bIsYAxis && bIsLeftOrBottomAxis + ? drawing::TextHorizontalAdjust_RIGHT + : drawing::TextHorizontalAdjust_LEFT; + } +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/axes/VCoordinateSystem.cxx b/chart2/source/view/axes/VCoordinateSystem.cxx new file mode 100644 index 000000000000..dc9c9e08cc6d --- /dev/null +++ b/chart2/source/view/axes/VCoordinateSystem.cxx @@ -0,0 +1,226 @@ +/************************************************************************* + * + * $RCSfile: VCoordinateSystem.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "VCoordinateSystem.hxx" +#include "ScaleAutomatism.hxx" +#include "VSeriesPlotter.hxx" +#include "VGrid.hxx" + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +VCoordinateSystem::VCoordinateSystem( const uno::Reference< XBoundedCoordinateSystem >& xCooSys ) + : m_xCooSysModel(xCooSys) + , m_xAxis0(NULL) + , m_xAxis1(NULL) + , m_xAxis2(NULL) + , m_xGridList0() + , m_xGridList1() + , m_xGridList2() + , m_aExplicitScales(3) + , m_aExplicitIncrements(3) +{ +} +VCoordinateSystem::~VCoordinateSystem() +{ + +} + +void VCoordinateSystem::setOrigin( double* fCoordinateOrigin ) +{ + m_fCoordinateOrigin[0]=fCoordinateOrigin[0]; + m_fCoordinateOrigin[1]=fCoordinateOrigin[1]; + m_fCoordinateOrigin[2]=fCoordinateOrigin[2]; +} + +uno::Reference< XBoundedCoordinateSystem > VCoordinateSystem::getModel() const +{ + return m_xCooSysModel; +} + +void VCoordinateSystem::addAxis( const uno::Reference< XAxis >& xAxis ) +{ + if(!xAxis.is()) + return; + sal_Int32 nDim = xAxis->getRepresentedDimension(); + if(0==nDim) + m_xAxis0 = xAxis; + else if(1==nDim) + m_xAxis1 = xAxis; + else if(2==nDim) + m_xAxis2 = xAxis; +} + +uno::Sequence< uno::Reference< XGrid > >& VCoordinateSystem::getGridListByDimension( sal_Int32 nDim ) +{ + if( 0==nDim ) + return m_xGridList0; + if( 1==nDim ) + return m_xGridList1; + return m_xGridList2; +} + +void VCoordinateSystem::addGrid( const uno::Reference< XGrid >& xGrid ) +{ + if(!xGrid.is()) + return; + sal_Int32 nDim = xGrid->getRepresentedDimension(); + uno::Sequence< uno::Reference< XGrid > >& rGridList + = getGridListByDimension( nDim ); + + rGridList.realloc(rGridList.getLength()+1); + rGridList[rGridList.getLength()-1] = xGrid; +} + +void VCoordinateSystem::createGridShapes( + const uno::Reference< lang::XMultiServiceFactory>& xShapeFactory + , const uno::Reference< drawing::XShapes >& xTarget + , const drawing::HomogenMatrix& rHM_SceneToScreen ) +{ + sal_Int32 nDimensionCount = m_xCooSysModel->getDimension(); + for( sal_Int32 nDim=0; nDim<3; nDim++) + { + uno::Sequence< uno::Reference< XGrid > >& rGridList + = getGridListByDimension( nDim ); + for( sal_Int32 nN=0; nN<rGridList.getLength(); nN++ ) + { + VGrid aGrid(rGridList[nN],nDimensionCount); + aGrid.setMeterData( m_aExplicitScales[nDim], m_aExplicitIncrements[nDim] ); + + aGrid.init(xTarget,xTarget,xShapeFactory); + if(2==nDimensionCount) + aGrid.setTransformationSceneToScreen( rHM_SceneToScreen ); + aGrid.setScales( m_aExplicitScales ); + aGrid.createShapes(); + } + } +} + +uno::Reference< XAxis > VCoordinateSystem::getAxisByDimension( sal_Int32 nDim ) const +{ + uno::Reference< XAxis > xAxis(NULL); + if(0==nDim) + xAxis = m_xAxis0; + else if(1==nDim) + xAxis = m_xAxis1; + else if(2==nDim) + xAxis = m_xAxis2; + return xAxis; +} + +void setExplicitScaleToDefault( ExplicitScaleData& rExplicitScale ) +{ + rExplicitScale.Minimum = 0.0; + rExplicitScale.Maximum = 1.0; + rExplicitScale.Orientation = AxisOrientation_MATHEMATICAL; + //rExplicitScale.Scaling = ; + //rExplicitScale.Breaks = ; +} + +void VCoordinateSystem::doAutoScale( MinimumAndMaximumSupplier* pMinMaxSupplier ) +{ + for( sal_Int32 nDim = 0; nDim < 2; nDim++ ) + { + if(nDim < 0 || nDim > 2 ) + return; + + uno::Reference< XScale > xScale( + m_xCooSysModel->getScaleByDimension( nDim ), + uno::UNO_QUERY ); + if( ! xScale.is() ) + return; + ScaleAutomatism aScaleAutomatism( xScale->getScaleData() ); + uno::Reference< XAxis > xAxis( this->getAxisByDimension(nDim) ); + if(xAxis.is()) + { + uno::Reference< XIncrement > xInc( xAxis->getIncrement() ); + if( xInc.is() ) + { + aScaleAutomatism.m_aSourceIncrement = xInc->getIncrementData(); + aScaleAutomatism.m_aSourceSubIncrementList = xInc->getSubIncrements(); + } + } + if(0==nDim) + { + aScaleAutomatism.m_fValueMinimum = pMinMaxSupplier->getMinimumX(); + aScaleAutomatism.m_fValueMaximum = pMinMaxSupplier->getMaximumX(); + } + else if(1==nDim) + { + const ExplicitScaleData& rScale = m_aExplicitScales[0]; + //@todo iterate through all xSlots which belong to coordinate system dimension in this plotter + //and iterate through all plotter for this coordinate system dimension + sal_Int32 nXSlotIndex = 0; + aScaleAutomatism.m_fValueMinimum = pMinMaxSupplier->getMinimumYInRange(rScale.Minimum,rScale.Maximum); + aScaleAutomatism.m_fValueMaximum = pMinMaxSupplier->getMaximumYInRange(rScale.Minimum,rScale.Maximum); + } + aScaleAutomatism.calculateExplicitScaleAndIncrement( + m_aExplicitScales[nDim], m_aExplicitIncrements[nDim] ); + } + setExplicitScaleToDefault(m_aExplicitScales[2]); +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/axes/makefile.mk b/chart2/source/view/axes/makefile.mk new file mode 100644 index 000000000000..dd0fac9cff24 --- /dev/null +++ b/chart2/source/view/axes/makefile.mk @@ -0,0 +1,91 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ= ..$/..$/.. +PRJINC= $(PRJ)$/source +PRJNAME= chart2 +TARGET= chvaxes + +ENABLE_EXCEPTIONS= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: settings.mk +#.IF "$(GUI)" == "WNT" +#CFLAGS+=-GR +#.ENDIF + +# --- export library ------------------------------------------------- + +#object files to build and link together to lib $(SLB)$/$(TARGET).lib +SLOFILES = \ + $(SLO)$/VMeterBase.obj \ + $(SLO)$/TickmarkHelper.obj \ + $(SLO)$/ScaleAutomatism.obj \ + $(SLO)$/VCoordinateSystem.obj \ + $(SLO)$/VAxisProperties.obj \ + $(SLO)$/VAxis.obj \ + $(SLO)$/VGrid.obj + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx new file mode 100644 index 000000000000..8fc65d9fe9f1 --- /dev/null +++ b/chart2/source/view/charttypes/AreaChart.cxx @@ -0,0 +1,464 @@ +#include "AreaChart.hxx" +#include "PlottingPositionHelper.hxx" +#include "ShapeFactory.hxx" +//#include "chartview/servicenames_charttypes.hxx" +//#include "chartview/servicenames_coosystems.hxx" +#include "CommonConverters.hxx" +#include "macros.hxx" +#include "ViewDefines.hxx" +#include "TransformationHelper.hxx" +#include "chartview/ObjectIdentifier.hxx" + +#ifndef _SV_GEN_HXX +#include <vcl/gen.hxx> +#endif +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif +#ifndef _TOOLS_COLOR_HXX +#include <tools/color.hxx> +#endif +#ifndef _SVX_UNOPRNMS_HXX +#include <svx/unoprnms.hxx> +#endif +#ifndef INCLUDED_RTL_MATH_HXX +#include <rtl/math.hxx> +#endif + +#ifndef _COM_SUN_STAR_LANG_XSERVICENAME_HPP_ +#include <com/sun/star/lang/XServiceName.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::rtl::math; +using namespace ::drafts::com::sun::star::chart2; + +class AreaPositionHelper : public PlottingPositionHelper +{ +public: + AreaPositionHelper(); //@todo + virtual ~AreaPositionHelper(); + + //double getSlotPos( double fCategoryX ) const; + + double getTransformedDepth() const; + Rectangle getTransformedClipRect() const; + + double getLogicGrounding() const; + +private: //member +}; + +AreaPositionHelper::AreaPositionHelper() +{ +} + +AreaPositionHelper::~AreaPositionHelper() +{ +} + +double AreaPositionHelper::getTransformedDepth() const +{ + double MinZ = getLogicMinZ(); + double MaxZ = getLogicMaxZ(); + if(m_aScales[2].Scaling.is()) + MinZ = m_aScales[2].Scaling->doScaling(MinZ); + if(m_aScales[2].Scaling.is()) + MaxZ = m_aScales[2].Scaling->doScaling(MaxZ); + return FIXED_SIZE_FOR_3D_CHART_VOLUME/(MaxZ-MinZ); +} + +Rectangle AreaPositionHelper::getTransformedClipRect() const +{ + //get logic clip values: + double MinX = getLogicMinX(); + double MinY = getLogicMinY(); + double MinZ = getLogicMinZ(); + double MaxX = getLogicMaxX(); + double MaxY = getLogicMaxY(); + double MaxZ = getLogicMaxZ(); + + //apply scaling + doLogicScaling( &MinX, &MinY, &MinZ ); + doLogicScaling( &MaxX, &MaxY, &MaxZ); + + drawing::Position3D aMimimum( MinX, MinY, MinZ); + drawing::Position3D aMaximum( MaxX, MaxY, MaxZ); + + //transform to screen coordinates + aMimimum = SequenceToPosition3D( getTransformationLogicToScene() + ->transform( Position3DToSequence(aMimimum) ) ); + aMaximum = SequenceToPosition3D( getTransformationLogicToScene() + ->transform( Position3DToSequence(aMaximum) ) ); + + Rectangle aRet( aMimimum.PositionX, aMaximum.PositionY, aMaximum.PositionX, aMimimum.PositionY ); + return aRet; +} + +double AreaPositionHelper::getLogicGrounding() const +{ + //@todo get this from model axis crosses at if that value is between min and max + //@todo get this for other directions - so far only y + double fRet=0.0; + uno::Reference< lang::XServiceName > xServiceName( m_aScales[1].Scaling, uno::UNO_QUERY ); + bool bIsLogarithm = ( xServiceName.is() && (xServiceName->getServiceName()).equals( + C2U( "com.sun.star.chart2.LogarithmicScaling" ))); + if( bIsLogarithm ) + fRet = m_aScales[1].Minimum; + return fRet; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +AreaChart::AreaChart( sal_Int32 nDimension ) + : VSeriesPlotter( nDimension ) + , m_pPosHelper( new AreaPositionHelper() ) +{ + PlotterBase::m_pPosHelper = m_pPosHelper; +} + +AreaChart::~AreaChart() +{ + delete m_pPosHelper; +} + +//----------------------------------------------------------------- +// lang::XServiceInfo +//----------------------------------------------------------------- +/* +APPHELPER_XSERVICEINFO_IMPL(AreaChart,CHART2_VIEW_AREACHART_SERVICE_IMPLEMENTATION_NAME) + + uno::Sequence< rtl::OUString > AreaChart +::getSupportedServiceNames_Static() +{ + uno::Sequence< rtl::OUString > aSNS( 1 ); + aSNS.getArray()[ 0 ] = CHART2_VIEW_AREACHART_SERVICE_NAME; + return aSNS; +} +*/ +/* +//----------------------------------------------------------------- +// chart2::XPlotter +//----------------------------------------------------------------- + + ::rtl::OUString SAL_CALL AreaChart +::getCoordinateSystemTypeID() + throw (uno::RuntimeException) +{ + return CHART2_COOSYSTEM_CARTESIAN2D_SERVICE_NAME; +} + + void SAL_CALL AreaChart +::setScales( const uno::Sequence< ExplicitScaleData >& rScales ) throw (uno::RuntimeException) +{ +} + void SAL_CALL AreaChart +::setTransformation( const uno::Reference< XTransformation >& xTransformationToLogicTarget, const uno::Reference< XTransformation >& xTransformationToFinalPage ) throw (uno::RuntimeException) +{ +} +*/ + +bool isPolygonEmptyOrSinglePoint(drawing::PolyPolygonShape3D& rPoly) +{ + if(!rPoly.SequenceX.getLength()) + return true; + if(rPoly.SequenceX[0].getLength()<=1) + return true; + return false; +} + +void closePolygon( drawing::PolyPolygonShape3D& rPoly) +{ + //add a last point == first point + if(isPolygonEmptyOrSinglePoint(rPoly)) + return; + drawing::Position3D aFirst(rPoly.SequenceX[0][0],rPoly.SequenceY[0][0],rPoly.SequenceZ[0][0]); + AddPointToPoly( rPoly, aFirst ); +} + +void AreaChart::addSeries( VDataSeries* pSeries, sal_Int32 xSlot, sal_Int32 ySlot ) +{ + VSeriesPlotter::addSeries( pSeries, xSlot, ySlot ); +} + +void AreaChart::createShapes() +{ + DBG_ASSERT(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is(),"AreaChart is not proper initialized"); + if(!(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is())) + return; + + //--------------------------------------------- + //check necessary here that different Y axis can not be stacked in the same group? ... hm? + + //update/create information for current group + double fLogicZ = 0.0;//as defined + double fLogicBaseWidth = 1.0;//as defined + double fLogicBaseDepth = fLogicBaseWidth;//Logic Depth and Width are identical by define ... (symmetry is not necessary anymore) + + sal_Int32 nStartIndex = 0; // inclusive ;..todo get somehow from x scale + sal_Int32 nEndIndex = VSeriesPlotter::getPointCount(m_aXSlots); + if(nEndIndex<=0) + nEndIndex=1; +//============================================================================= + //iterate through all x values per indices + for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ ) + { + ::std::vector< VDataSeriesGroup >::iterator aXSlotIter = m_aXSlots.begin(); + const ::std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = m_aXSlots.end(); +//============================================================================= + //for the area chart there should be at most one x slot (no side by side stacking available) + //attention different: xSlots are always interpreted as independent areas one behind the other: @todo this doesn't work why not??? + for( ; aXSlotIter != aXSlotEnd; aXSlotIter++ ) + { + ::std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector); + + ::std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin(); + const ::std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end(); + + double fLogicYForNextSeries = 0.0; + + double fLogicYSum = 0.0; + for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ ) + { + double fAdd = (*aSeriesIter)->getY( nIndex ); + if( !::rtl::math::isNan(fAdd) ) + fLogicYSum += fAdd; + } + aSeriesIter = pSeriesList->begin(); +//============================================================================= + //iterate through all series + for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ ) + { + uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShape(*aSeriesIter, m_xLogicTarget); + + //set z order for series group shape + { + uno::Reference< beans::XPropertySet > xProp( xSeriesGroupShape_Shapes, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + uno::Any aAZOrder = xProp->getPropertyValue( C2U( UNO_NAME_MISC_OBJ_ZORDER ) ); + sal_Int32 nZOrder=33; + aAZOrder >>= nZOrder; + xProp->setPropertyValue( C2U( UNO_NAME_MISC_OBJ_ZORDER ) + , uno::makeAny( sal_Int32(0) ) ); + } + catch( uno::Exception& e ) + { + e; + } + } + } + + //collect data point information (logic coordinates, style ): + double fLogicX = (*aSeriesIter)->getX(nIndex); + double fLogicY = (*aSeriesIter)->getY(nIndex); + if( ::rtl::math::isNan(fLogicY) ) + fLogicY=0;//@todo maybe there is another grounding ?? - for sum 0 is right + fLogicY += fLogicYForNextSeries; + fLogicYForNextSeries = fLogicY; + + bool bIsVisible = m_pPosHelper->isLogicVisible( fLogicX, fLogicY, fLogicZ ); + + //remind minimal and maximal x values for area 'grounding' points + //only for filled area + { + double& rfMinX = (*aSeriesIter)->m_fMinX; + if(!nIndex||fLogicX<rfMinX) + rfMinX=fLogicX; + double& rfMaxX = (*aSeriesIter)->m_fMaxX; + if(!nIndex||fLogicX>rfMaxX) + rfMaxX=fLogicX; + } + + //apply scaling + //(for more accurat clipping it would be better to first clip and than scale and transform, + //but as long as we only have integer Polygon clipping we need to apply scaling and transformation first ) see QQQ + m_pPosHelper->doLogicScaling( &fLogicX, &fLogicY, &fLogicZ ); + + //store point information for series polygon + //for area and/or line (symbols only do not need this) + if( !::rtl::math::isNan(fLogicX) && !::rtl::math::isInf(fLogicX) + && !::rtl::math::isNan(fLogicY) && !::rtl::math::isInf(fLogicY) + && !::rtl::math::isNan(fLogicZ) && !::rtl::math::isInf(fLogicZ) ) + { + drawing::PolyPolygonShape3D& rSeriesPoly = (*aSeriesIter)->m_aPolyPolygonShape3D; + drawing::Position3D aScaledLogicPosition( fLogicX, fLogicY,fLogicZ); + //transformation 3) -> 4) + drawing::Position3D aTransformedPosition( + SequenceToPosition3D( + m_pPosHelper->getTransformationLogicToScene()->transform( + Position3DToSequence(aScaledLogicPosition) ) ) ); + AddPointToPoly( rSeriesPoly, aTransformedPosition ); + } + + //create a single datapoint if point is visible + //apply clipping: + if( !bIsVisible ) + continue; + + //create a group shape for this point and add to the series shape: + rtl::OUString aPointCID = ObjectIdentifier::createPointCID( + (*aSeriesIter)->getPointCID_Stub(), nIndex ); + uno::Reference< drawing::XShapes > xPointGroupShape_Shapes( + createGroupShape(xSeriesGroupShape_Shapes,aPointCID) ); + uno::Reference<drawing::XShape> xPointGroupShape_Shape = + uno::Reference<drawing::XShape>( xPointGroupShape_Shapes, uno::UNO_QUERY ); + + { + DataPointGeometry aLogicGeom( drawing::Position3D(fLogicX,fLogicY,fLogicZ) + , drawing::Direction3D(1,1,1) ); + //transformation 3) -> 4) + DataPointGeometry aTransformedGeom( + TransformationHelper::transformLogicGeom( + aLogicGeom,m_pPosHelper->getTransformationLogicToScene()) ); + + //create data point + bool bShowSymbols = false; + if( bShowSymbols ) + { + if(m_nDimension==3) + { + m_pShapeFactory->createSymbol3D( xPointGroupShape_Shapes + , aTransformedGeom + , (*aSeriesIter)->getAppearanceOfPoint( nIndex ) ); + } + else //m_nDimension!=3 + { + m_pShapeFactory->createSymbol2D( xPointGroupShape_Shapes + , aTransformedGeom + , (*aSeriesIter)->getAppearanceOfPoint( nIndex ) ); + } + } + } + + //remove PointGroupShape if empty + if(!xPointGroupShape_Shapes->getCount()) + xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shape); + + }//next series in x slot (next y slot) + }//next x slot + }//next category +//============================================================================= +//============================================================================= +//============================================================================= + + //iterate through all series again to create the series shapes + ::std::vector< VDataSeriesGroup >::iterator aXSlotIter = m_aXSlots.begin(); + const ::std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = m_aXSlots.end(); +//============================================================================= + //for the area chart there should be at most one x slot (no side by side stacking available) + if( aXSlotIter != aXSlotEnd ) + { + ::std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector); + + ::std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin(); + const ::std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end(); +//============================================================================= + + drawing::PolyPolygonShape3D* pPreviousSeriesPoly = NULL; + drawing::PolyPolygonShape3D* pSeriesPoly = NULL; + + //iterate through all series + for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ ) + { + uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShape(*aSeriesIter, m_xLogicTarget); + pSeriesPoly = &(*aSeriesIter)->m_aPolyPolygonShape3D; + + double zValue = m_pPosHelper->getLogicMinZ(); + + drawing::PolyPolygonShape3D aPoly( *pSeriesPoly ); + //add second part to the polygon (grounding points or previous series points) + if(!pPreviousSeriesPoly) + { + double fMinX = (*aSeriesIter)->m_fMinX; + double fMaxX = (*aSeriesIter)->m_fMaxX; + //clip to scale + if(fMaxX<m_pPosHelper->getLogicMinX() || fMinX>m_pPosHelper->getLogicMaxX()) + continue;//no visible shape needed + if(fMaxX > m_pPosHelper->getLogicMaxX()) + fMaxX = m_pPosHelper->getLogicMaxX(); + if(fMinX < m_pPosHelper->getLogicMinX()) + fMinX = m_pPosHelper->getLogicMinX(); + + //apply scaling + { + m_pPosHelper->doLogicScaling( &fMinX, NULL, &zValue ); + m_pPosHelper->doLogicScaling( &fMaxX, NULL, NULL ); + } + double fY = m_pPosHelper->getLogicGrounding(); + + drawing::Position3D aScaledLogicPosition2( fMaxX,fY,zValue); + drawing::Position3D aTransformedPosition2( SequenceToPosition3D( m_pPosHelper->getTransformationLogicToScene()->transform( Position3DToSequence(aScaledLogicPosition2) ) ) ); + AddPointToPoly( aPoly, aTransformedPosition2 ); + + drawing::Position3D aScaledLogicPosition( fMinX,fY,zValue); + drawing::Position3D aTransformedPosition( SequenceToPosition3D( m_pPosHelper->getTransformationLogicToScene()->transform( Position3DToSequence(aScaledLogicPosition) ) ) ); + AddPointToPoly( aPoly, aTransformedPosition ); + } + else + { + appendPoly( aPoly, *pPreviousSeriesPoly ); + } + + closePolygon(aPoly); + + //apply clipping + //(for more accurat clipping it would be better to first clip and than scale and transform, + //but as long as we only have integer Polygon clipping we need to apply scaling and transformation first ) see QQQ + { + Polygon aToolsPoly = PolyToToolsPoly( aPoly ); + aToolsPoly.Clip( m_pPosHelper->getTransformedClipRect() ); + aPoly = ToolsPolyToPoly( aToolsPoly, zValue ); + closePolygon(aPoly); //again necessary after clipping + } + + if(isPolygonEmptyOrSinglePoint(aPoly)) + continue; + + //create area: + uno::Reference< drawing::XShape > xShape(NULL); + if(m_nDimension==3) + { + xShape = m_pShapeFactory->createArea3D( xSeriesGroupShape_Shapes + , aPoly, m_pPosHelper->getTransformedDepth() ); + } + else //m_nDimension!=3 + { + xShape = m_pShapeFactory->createArea2D( xSeriesGroupShape_Shapes + , aPoly ); + } + this->setMappedProperties( xShape + , (*aSeriesIter)->getPropertiesOfSeries() + , m_aShapePropertyMapForArea ); + pPreviousSeriesPoly = pSeriesPoly; + }//next series in x slot (next y slot) + }//next x slot +//============================================================================= +//============================================================================= + + /* @todo remove series shapes if empty + //remove and delete point-group-shape if empty + if(!xSeriesGroupShape_Shapes->getCount()) + { + (*aSeriesIter)->m_xShape.set(NULL); + m_xLogicTarget->remove(xSeriesGroupShape_Shape); + } + */ + + //remove and delete series-group-shape if empty + + //... todo +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/charttypes/AreaChart.hxx b/chart2/source/view/charttypes/AreaChart.hxx new file mode 100644 index 000000000000..bb4fa37ad49d --- /dev/null +++ b/chart2/source/view/charttypes/AreaChart.hxx @@ -0,0 +1,47 @@ +#ifndef _CHART2_AREACHART_HXX +#define _CHART2_AREACHART_HXX + +#include "VSeriesPlotter.hxx" + +//............................................................................. +namespace chart +{ +//............................................................................. +class AreaPositionHelper; + +class AreaChart : public VSeriesPlotter +{ + //------------------------------------------------------------------------- + // public methods + //------------------------------------------------------------------------- +public: + AreaChart( sal_Int32 nDimension ); + virtual ~AreaChart(); + + //------------------------------------------------------------------------- + // chart2::XPlotter + //------------------------------------------------------------------------- + + virtual void SAL_CALL createShapes(); + /* + virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setScales( const ::com::sun::star::uno::Sequence< ::drafts::com::sun::star::chart2::ExplicitScaleData >& rScales ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException); + */ + + virtual void addSeries( VDataSeries* pSeries, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 ); + + //------------------------------------------------------------------------- + //------------------------------------------------------------------------- + //------------------------------------------------------------------------- +private: //methods + //no default constructor + AreaChart(); + +private: //member + AreaPositionHelper* m_pPosHelper; +}; +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx new file mode 100644 index 000000000000..22e2e8d19988 --- /dev/null +++ b/chart2/source/view/charttypes/BarChart.cxx @@ -0,0 +1,544 @@ +#include "BarChart.hxx" +#include "PlottingPositionHelper.hxx" +#include "ShapeFactory.hxx" +//#include "chartview/servicenames_charttypes.hxx" +//#include "chartview/servicenames_coosystems.hxx" +#include "CommonConverters.hxx" +#include "macros.hxx" +#include "Linear3DTransformation.hxx" +#include "ViewDefines.hxx" +#include "CategoryPositionHelper.hxx" +#include "TransformationHelper.hxx" +#include "chartview/ObjectIdentifier.hxx" + +#ifndef _SV_GEN_HXX +#include <vcl/gen.hxx> +#endif +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif +#ifndef _TOOLS_COLOR_HXX +#include <tools/color.hxx> +#endif +#ifndef _SVX_UNOPRNMS_HXX +#include <svx/unoprnms.hxx> +#endif +#ifndef INCLUDED_RTL_MATH_HXX +#include <rtl/math.hxx> +#endif + +// #define TRANSP_GRADIENT_HACK 1 + +#ifdef TRANSP_GRADIENT_HACK +# ifndef _DRAFTS_COM_SUN_STAR_CHART2_TRANSPARENCYSTYLE_HPP_ +# include <drafts/com/sun/star/chart2/TransparencyStyle.hpp> +# endif +# ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_ +# include <com/sun/star/container/XNameContainer.hpp> +# endif +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::rtl::math; +using namespace ::drafts::com::sun::star::chart2; + +class BarPositionHelper : public CategoryPositionHelper, public PlottingPositionHelper +{ +public: + BarPositionHelper( double fSeriesCount=0 ); //@todo + virtual ~BarPositionHelper(); + + virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation > + getTransformationLogicToScene() const; + + void updateSeriesCount( double fSeriesCount ); /*only enter the size of x stacked series*/ + + double getStartCategoryIndex() const { + sal_Int32 nStart = static_cast<sal_Int32>(getLogicMinX() + 1.49);//@todo +0.5 if clipping of half categories is implemented + if( nStart < 0 ) + nStart = 0; + return nStart; + } + double getEndCategoryIndex() const { + sal_Int32 nEnd = static_cast<sal_Int32>(getLogicMaxX() + 0.5); + if( nEnd < 0 ) + nEnd = 0; + return nEnd; + } +}; + +BarPositionHelper::BarPositionHelper( double fSeriesCount ) + : CategoryPositionHelper( fSeriesCount) +{ +} + +BarPositionHelper::~BarPositionHelper() +{ +} + +void BarPositionHelper::updateSeriesCount( double fSeriesCount ) +{ + m_fSeriesCount = fSeriesCount; +} + +uno::Reference< XTransformation > BarPositionHelper::getTransformationLogicToScene() const +{ + //transformation from 2) to 4) //@todo 2) and 4) need a link to a document + + //we need to apply this transformation to each geometric object because of a bug/problem + //of the old drawing layer (the UNO_NAME_3D_EXTRUDE_DEPTH is an integer value instead of an double ) + + if( !m_xTransformationLogicToScene.is() ) + { + Matrix4D aMatrix; + + double MinX = getLogicMinX(); + double MinY = getLogicMinY(); + double MinZ = getLogicMinZ(); + double MaxX = getLogicMaxX(); + double MaxY = getLogicMaxY(); + double MaxZ = getLogicMaxZ(); + + //apply scaling + //scaling of x axis is refused/ignored + doLogicScaling( NULL, &MinY, &MinZ ); + doLogicScaling( NULL, &MaxY, &MaxZ); + + aMatrix.TranslateX(-MinX); + aMatrix.TranslateY(-MinY); + aMatrix.TranslateZ(-MinZ+0.5*getSlotWidth()); + + double fWidthX = MaxX - MinX; + double fWidthY = MaxY - MinY; + double fWidthZ = MaxZ - MinZ; + + aMatrix.ScaleX(FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthX); + aMatrix.ScaleY(FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthY); + aMatrix.ScaleZ(FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthZ/getSlotWidth()); + + //if(nDim==2) + aMatrix = aMatrix*m_aMatrixScreenToScene; + + m_xTransformationLogicToScene = new Linear3DTransformation(Matrix4DToHomogenMatrix( aMatrix )); + } + return m_xTransformationLogicToScene; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +BarChart::BarChart( sal_Int32 nDimension ) + : VSeriesPlotter( nDimension ) + , m_pPosHelper( new BarPositionHelper() ) +{ + PlotterBase::m_pPosHelper = m_pPosHelper; +} + +BarChart::~BarChart() +{ + delete m_pPosHelper; +} + +//----------------------------------------------------------------- +// lang::XServiceInfo +//----------------------------------------------------------------- +/* +APPHELPER_XSERVICEINFO_IMPL(BarChart,CHART2_VIEW_BARCHART_SERVICE_IMPLEMENTATION_NAME) + + uno::Sequence< rtl::OUString > BarChart +::getSupportedServiceNames_Static() +{ + uno::Sequence< rtl::OUString > aSNS( 1 ); + aSNS.getArray()[ 0 ] = CHART2_VIEW_BARCHART_SERVICE_NAME; + return aSNS; +} +*/ +/* +//----------------------------------------------------------------- +// chart2::XPlotter +//----------------------------------------------------------------- + + ::rtl::OUString SAL_CALL BarChart +::getCoordinateSystemTypeID() + throw (uno::RuntimeException) +{ + return CHART2_COOSYSTEM_CARTESIAN2D_SERVICE_NAME; +} + + void SAL_CALL BarChart +::setScales( const uno::Sequence< ExplicitScaleData >& rScales ) throw (uno::RuntimeException) +{ +} + void SAL_CALL BarChart +::setTransformation( const uno::Reference< XTransformation >& xTransformationToLogicTarget, const uno::Reference< XTransformation >& xTransformationToFinalPage ) throw (uno::RuntimeException) +{ +} +*/ + +uno::Reference< drawing::XShape > BarChart::createDataPoint2D_Bar( + const uno::Reference< drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , const uno::Reference< beans::XPropertySet >& xObjectProperties + ) +{ + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.drawing.RectangleShape" ) ) ), uno::UNO_QUERY ); + xTarget->add(xShape); + + //@todo check wether this needs to be done before transformation to avoid rounding errors + double fLeftCorner = rGeometry.m_aPosition.PositionX - rGeometry.m_aSize.DirectionX/2.0; + xShape->setPosition(awt::Point( + static_cast<sal_Int32>(fLeftCorner) + ,static_cast<sal_Int32>(rGeometry.m_aPosition.PositionY))); + xShape->setSize(rGeometry.getSize2D()); + this->setMappedProperties( xShape, xObjectProperties, m_aShapePropertyMapForArea ); +/* +#ifdef TRANSP_GRADIENT_HACK + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + //HACK: Setting a transparency gradient currently does not work well. With + //this hack you can create one gradient that is the only one used. + // see bug #110940#. + + // if transparency style is not gradient, disable it by setting + // FillTransparenceGradientName to an empty string + // Note: TransparencyStyle should become a new property in FillProperties + // (FillTransparenceStyle) + ::drafts::com::sun::star::chart2::TransparencyStyle aTransStyle; + xObjectProperties->getPropertyValue( C2U( "TransparencyStyle" )) >>= aTransStyle; + if( aTransStyle != ::drafts::com::sun::star::chart2::TransparencyStyle_GRADIENT ) + { + xProp->setPropertyValue( C2U( "FillTransparenceGradientName" ), + uno::makeAny( ::rtl::OUString())); + } + else + { + uno::Reference< container::XNameContainer > xGradientTable( + m_xShapeFactory->createInstance( + C2U( "com.sun.star.drawing.TransparencyGradientTable" )), uno::UNO_QUERY ); + // note: generate unique name + if( ! xGradientTable->hasByName( C2U( "Test" ) ) ) + { + xGradientTable->insertByName( C2U( "Test" ), + xObjectProperties->getPropertyValue( C2U( "TransparencyGradient"))); + } + xProp->setPropertyValue( C2U( "FillTransparenceGradientName" ), + uno::makeAny( C2U( "Test" ))); + } +#endif +*/ + return xShape; +} + +uno::Reference< drawing::XShape > BarChart::createDataPoint3D_Bar( + const uno::Reference< drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , const uno::Reference< beans::XPropertySet >& xObjectProperties + , Geometry3D eGeometry ) +{ + uno::Reference< drawing::XShape > xShape(NULL); + //test @todo remove + eGeometry = GEOMETRY_CYLINDER; + switch( eGeometry ) + { + case GEOMETRY_CYLINDER: + xShape = m_pShapeFactory->createCylinder( xTarget, rGeometry ); + break; + case GEOMETRY_CONE: + xShape = m_pShapeFactory->createCone( xTarget, rGeometry ); + break; + case GEOMETRY_PYRAMID: + xShape = m_pShapeFactory->createPyramid( xTarget, rGeometry ); + break; + case GEOMETRY_CUBOID: + default: + xShape = m_pShapeFactory->createRoundedCube( xTarget, rGeometry ); + } + this->setMappedProperties( xShape, xObjectProperties, m_aShapePropertyMapForArea ); + return xShape; +} + +void BarChart::createShapes() +{ + DBG_ASSERT(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is(),"BarChart is not proper initialized"); + if(!(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is())) + return; + + //the text labels should be always on top of the other series shapes + //therefore create an own group for the texts to move them to front + //(because the text group is created after the series group the texts are displayed on top) + uno::Reference< drawing::XShapes > xSeriesTarget( + createGroupShape( m_xLogicTarget,rtl::OUString() )); + uno::Reference< drawing::XShapes > xTextTarget( + createGroupShape( m_xLogicTarget,rtl::OUString() )); + + //--------------------------------------------- + //check necessary here that different Y axis can not be stacked in the same group? ... hm? + + //update/create information for current group + m_pPosHelper->updateSeriesCount( m_aXSlots.size() ); + double fLogicZ = 0.0;//as defined + double fLogicBaseWidth = m_pPosHelper->getSlotWidth(); + + //(@todo maybe different iteration for breaks in axis ?) + sal_Int32 nStartCategoryIndex = static_cast<sal_Int32>(m_pPosHelper->getStartCategoryIndex()); // inclusive + sal_Int32 nEndCategoryIndex = static_cast<sal_Int32>(m_pPosHelper->getEndCategoryIndex()); //inclusive +//============================================================================= + //iterate through all shown categories + for( sal_Int32 nCatIndex = nStartCategoryIndex; nCatIndex < nEndCategoryIndex; nCatIndex++ ) + { + ::std::vector< VDataSeriesGroup >::iterator aXSlotIter = m_aXSlots.begin(); + const ::std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = m_aXSlots.end(); +//============================================================================= + //iterate through all x slots in this category + for( double fSlotX=0; aXSlotIter != aXSlotEnd; aXSlotIter++, fSlotX+=1.0 ) + { + ::std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector); + + double fLogicPositiveYSum = 0.0, fLogicNegativeYSum = 0.0; + aXSlotIter->calculateYSumsForCategory( nCatIndex, fLogicPositiveYSum, fLogicNegativeYSum ); + if(fLogicPositiveYSum==0.0 && fLogicNegativeYSum==0.0) + continue; + + double fScaledLogicPositiveYSum = 0.0, fScaledLogicNegativeYSum = 0.0; + m_pPosHelper->doLogicScaling(NULL,&fScaledLogicPositiveYSum,NULL); + m_pPosHelper->doLogicScaling(NULL,&fScaledLogicNegativeYSum,NULL); + + double fPositiveLogicYForNextSeries = 0.0; + double fNegativeLogicYForNextSeries = 0.0; + + ::std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin(); + const ::std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end(); + aSeriesIter = pSeriesList->begin(); +//============================================================================= + //iterate through all series in this x slot + for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ ) + { + uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes( + getSeriesGroupShape(*aSeriesIter, xSeriesTarget) ); + uno::Reference< drawing::XShapes > xLabelGroupShape_Shapes( + getLabelsGroupShape(*aSeriesIter, xTextTarget) ); + + //collect data point information (logic coordinates, style ): + double fLogicX = m_pPosHelper->getSlotPos( (double)nCatIndex, fSlotX ); + double fLogicBarHeight = (*aSeriesIter)->getY( nCatIndex ); + if( ::rtl::math::isNan( fLogicBarHeight )) //no value at this category + continue; + if(fLogicBarHeight==0.0)//@todo: continue also if the resolution to small + continue; + + //todo sort negative and positive values, to display them on different sides of the Y axis + bool bPositive = fLogicBarHeight > 0.0; + double fLowerYValue = bPositive ? fPositiveLogicYForNextSeries : fNegativeLogicYForNextSeries; + double fUpperYValue = fLowerYValue+fLogicBarHeight; + if( bPositive ) + fPositiveLogicYForNextSeries += fLogicBarHeight; + else + fNegativeLogicYForNextSeries += fLogicBarHeight; + /* + if( !bPositive ) + { + double fHelp = fLowerYValue; + fLowerYValue = fUpperYValue; + fUpperYValue = fHelp; + } + */ + + //@todo ... start an iteration over the different breaks of the axis + //each subsystem may add an additional shape to form the whole point + //create a group shape for this point and add to the series shape: +// uno::Reference< drawing::XShapes > xPointGroupShape_Shapes( createGroupShape(xSeriesGroupShape_Shapes) ); +// uno::Reference<drawing::XShape> xPointGroupShape_Shape = +// uno::Reference<drawing::XShape>( xPointGroupShape_Shapes, uno::UNO_QUERY ); + //as long as we do not iterate we do not need to create an additional group for each point + uno::Reference< drawing::XShapes > xPointGroupShape_Shapes = xSeriesGroupShape_Shapes; + + //@todo iterate through all subsystems to create partial points + { + //@todo select a suiteable PositionHelper for this subsystem + BarPositionHelper* pPosHelper = m_pPosHelper; + + //apply clipping to Y + //@todo clipping of X and Z is not fully integrated so far, as there is a need to create different objects + { + double fLower = bPositive ? fLowerYValue : fUpperYValue; + double fUpper = bPositive ? fUpperYValue : fLowerYValue; + if( fLower > pPosHelper->getLogicMaxY() ) + continue; + if( fUpper < pPosHelper->getLogicMinY() ) + continue; + if( fLower < pPosHelper->getLogicMinY() ) + fLower = pPosHelper->getLogicMinY(); + if( fUpper > pPosHelper->getLogicMaxY() ) + fUpper = pPosHelper->getLogicMaxY(); + if( approxEqual(fLower, fUpper) ) + continue; + fLowerYValue = bPositive ? fLower : fUpper; + fUpperYValue = bPositive ? fUpper : fLower; + } + + //apply scaling to Y before calculating width (necessary to maintain gradient in clipped objects) + pPosHelper->doLogicScaling(NULL,&fLowerYValue,NULL); + pPosHelper->doLogicScaling(NULL,&fUpperYValue,NULL); + //scaling of X and Z is not provided as the created objects should be symmetric in that dimensions + + //calculate resulting width + double fCompleteHeight = bPositive ? fScaledLogicPositiveYSum : fScaledLogicNegativeYSum; + double fLogicBarWidth = fLogicBaseWidth; + if(m_nDimension==3) + { + //@todo? modify depth and width only dependend on the geomtric form ... : + if(fCompleteHeight!=0.0) + fLogicBarWidth = fLogicBaseWidth*(fCompleteHeight-fLowerYValue)/(fCompleteHeight); + } + double fLogicBarDepth = fLogicBarWidth; //Logic Depth and Width are identical by define ... (symmetry is not necessary anymore) + + DataPointGeometry aLogicGeom( drawing::Position3D(fLogicX,fLowerYValue,fLogicZ) + , drawing::Direction3D(fLogicBarWidth,fUpperYValue-fLowerYValue,fLogicBarDepth) + , drawing::Direction3D(0,approxSub(fCompleteHeight,fUpperYValue),0) ); + //transformation 3) -> 4) + DataPointGeometry aTransformedGeom( + TransformationHelper::transformLogicGeom( + aLogicGeom,pPosHelper->getTransformationLogicToScene()) ); + + //create partial point + uno::Reference< drawing::XShape > xShape; + if(m_nDimension==3) + { + xShape = createDataPoint3D_Bar( + xPointGroupShape_Shapes + , aTransformedGeom + ,(*aSeriesIter)->getPropertiesOfPoint( nCatIndex ) + ,(*aSeriesIter)->getAppearanceOfPoint( nCatIndex ).m_eGeometry3D ); + } + else //m_nDimension!=3 + { + xShape = createDataPoint2D_Bar( + xPointGroupShape_Shapes + , aTransformedGeom + , (*aSeriesIter)->getPropertiesOfPoint( nCatIndex )); + } + //set name/classified ObjectID (CID) + ShapeFactory::setShapeName(xShape + , ObjectIdentifier::createPointCID( + (*aSeriesIter)->getPointCID_Stub(),nCatIndex) ); + + //------------ + //create data point label + + bool bMiddlePosition = false; + if( pSeriesList->begin() != pSeriesList->end() ) + bMiddlePosition = true; + + awt::Point aScreenPosition2D = awt::Point( + static_cast<sal_Int32>(aTransformedGeom.m_aPosition.PositionX) + ,static_cast<sal_Int32>(aTransformedGeom.m_aPosition.PositionY + +aTransformedGeom.m_aSize.DirectionY ) + ); + if(bMiddlePosition) + aScreenPosition2D.Y -= static_cast<sal_Int32>(aTransformedGeom.m_aSize.DirectionY/2.0); + + double fLogicSum = bPositive ? fLogicPositiveYSum : fLogicNegativeYSum; + this->createDataLabel( xLabelGroupShape_Shapes, *(*aSeriesIter), nCatIndex + , fLogicBarHeight, fLogicSum, aScreenPosition2D ); + }//end iteration through partial points + + //remove PointGroupShape if empty +// if(!xPointGroupShape_Shapes->getCount()) +// xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shape); + + }//next series in x slot (next y slot) + }//next x slot + }//next category +//============================================================================= +//============================================================================= +//============================================================================= + /* @todo remove series shapes if empty + //remove and delete point-group-shape if empty + if(!xSeriesGroupShape_Shapes->getCount()) + { + (*aSeriesIter)->m_xShape.set(NULL); + m_xLogicTarget->remove(xSeriesGroupShape_Shape); + } + */ + + //remove and delete series-group-shape if empty + + //... todo +} + +//e.g. for Rectangle +/* +uno::Reference< drawing::XShape > BarChart::createPartialPointShape( + CooPoint + series dependent properties ...(create a special struct for each chart type) + , uno::Reference< XThinCoordinateSystem > xCoo + , sal_Bool bIsInBreak + , PointStyle* pStyle ) +{ + //create one here; use scaling and transformation to logic target + + //maybe do not show anything in the break //maybe read the behavior out of the configuration + //if(bIsInBreak) + // return NULL; + + uno::Reference< drawing::XShape > xNewPartialPointShape( + m_xShapeFactory->createInstance( + rtl::OUString::createFromAscii( "com.sun.star.drawing.RectangleShape" ) ) + , uno::UNO_QUERY ); + //set size and position + { + // + } + if(pStyle||bIsInBreak) + { + //set style properties if any for a single point + uno::Reference< beans::XPropertySet > xProp( xNewPartialPointShape, uno::UNO_QUERY ); + xProp->setPropertyValue( ... ); + + //set special properties if point in break (e.g. additional transparency ...) + } +} + +//e.g. for BarChart in 2 dim cartesian coordinates: +sal_Bool ShapeFactory::isShown( const Sequence< ExplicitScaleData >& rScales, const CooPoint& rP, double dLogicalWidthBeforeScaling ) +{ + ASSERT(rScales.getLength()==2) + double dMin_x = rScales[0].Minimum; + double dMax_x = rScales[0].Maximum; + double dMin_y = rScales[1].Minimum; + double dMax_y = rScales[1].Maximum; + + //we know that we have cartesian geometry + Rectangle aSysRect( rScales[0].Minimum, rScales[1].Maximum, rScales[0].Maximum, rScales[1].Minimum ); + Rectangle aPointRect( dLogicalWidthBeforeScaling ) + if(rP) +} + +//----------------------------------------------------------------------------- + +class FatCoordinateSystem +{ +public: + //XCoordinateSystemType getType(); + Sequence<XThinCoordinateSystem> getCoordinateSystems(); +} + +class ThinCoordinateSystem +{ +private: + +public: + sal_Bool isBreak(); + Sequence< ExplicitScaleData > getScales();//SubScales without beak + + +} +*/ +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/charttypes/BarChart.hxx b/chart2/source/view/charttypes/BarChart.hxx new file mode 100644 index 000000000000..9c477f674115 --- /dev/null +++ b/chart2/source/view/charttypes/BarChart.hxx @@ -0,0 +1,63 @@ +#ifndef _CHART2_BARCHART_HXX +#define _CHART2_BARCHART_HXX + +#include "VSeriesPlotter.hxx" +#include "DatapointGeometry.hxx" + +//............................................................................. +namespace chart +{ +//............................................................................. +class BarPositionHelper; + +class BarChart : public VSeriesPlotter +{ + //------------------------------------------------------------------------- + // public methods + //------------------------------------------------------------------------- +public: + BarChart( sal_Int32 nDimension ); + virtual ~BarChart(); + + //------------------------------------------------------------------------- + // chart2::XPlotter + //------------------------------------------------------------------------- + + virtual void SAL_CALL createShapes(); + /* + virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setScales( const ::com::sun::star::uno::Sequence< ::drafts::com::sun::star::chart2::ExplicitScaleData >& rScales ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException); + */ + + //------------------------------------------------------------------------- + //------------------------------------------------------------------------- + //------------------------------------------------------------------------- + +private: //methods + //no default constructor + BarChart(); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createDataPoint3D_Bar( + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet >& xObjectProperties + , Geometry3D eGeometry ); + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createDataPoint2D_Bar( + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet >& xObjectProperties ); + +private: //member + BarPositionHelper* m_pPosHelper; +}; +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/view/charttypes/CategoryPositionHelper.cxx b/chart2/source/view/charttypes/CategoryPositionHelper.cxx new file mode 100644 index 000000000000..bb6001be36f8 --- /dev/null +++ b/chart2/source/view/charttypes/CategoryPositionHelper.cxx @@ -0,0 +1,54 @@ +#ifndef _CHART2_CATEGORYPOSITIONHELPER_HXX +#include "CategoryPositionHelper.hxx" +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +//using namespace ::com::sun::star; +//using namespace ::drafts::com::sun::star::chart2; + +CategoryPositionHelper::CategoryPositionHelper( double fSeriesCount, double fCategoryWidth ) + : m_fSeriesCount(fSeriesCount) + , m_fCategoryWidth(fCategoryWidth) + , m_fInnerDistance(0.0) + , m_fOuterDistance(1.0) +{ +} + +CategoryPositionHelper::CategoryPositionHelper() + : m_fSeriesCount(1.0) + , m_fCategoryWidth(1.0) + , m_fInnerDistance(0.0) + , m_fOuterDistance(0.0) +{ +} + +CategoryPositionHelper::~CategoryPositionHelper() +{ +} + +double CategoryPositionHelper::getSlotWidth() const +{ + double fWidth = m_fCategoryWidth / + ( m_fSeriesCount + + m_fOuterDistance + + m_fInnerDistance*( m_fSeriesCount - 1.0) ); + return fWidth; +} + +double CategoryPositionHelper::getSlotPos( double fCategoryX, double fSeriesNumber ) const +{ + //the returned position is in the middle of the rect + //fSeriesNumber 0...n-1 + double fPos = fCategoryX - (m_fCategoryWidth/2.0) + + (m_fOuterDistance/2.0 + fSeriesNumber*(1.0+m_fInnerDistance)) * getSlotWidth() + + getSlotWidth()/2.0; + + return fPos; +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/charttypes/CategoryPositionHelper.hxx b/chart2/source/view/charttypes/CategoryPositionHelper.hxx new file mode 100644 index 000000000000..ec1d3ec594df --- /dev/null +++ b/chart2/source/view/charttypes/CategoryPositionHelper.hxx @@ -0,0 +1,35 @@ +#ifndef _CHART2_CATEGORYPOSITIONHELPER_HXX +#define _CHART2_CATEGORYPOSITIONHELPER_HXX + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +class CategoryPositionHelper +{ +public: + CategoryPositionHelper( double fSeriesCount, double CategoryWidth = 1.0); + CategoryPositionHelper(); + virtual ~CategoryPositionHelper(); + + double getSlotWidth() const; + double getSlotPos( double fCategoryX, double fSeriesNumber ) const; + +protected: + double m_fSeriesCount; + double m_fCategoryWidth; + //Distance between two neighboring bars in same category, seen relative to width of the bar: + double m_fInnerDistance; //[-1,1] m_fInnerDistance=1 --> distance == width; m_fInnerDistance=-1-->all rects are painted on the same position + //Distance between two neighboring bars in different category, seen relative to width of the bar: + double m_fOuterDistance; //>=0 m_fOuterDistance=1 --> distance == width +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx new file mode 100644 index 000000000000..42ec542ef855 --- /dev/null +++ b/chart2/source/view/charttypes/PieChart.cxx @@ -0,0 +1,485 @@ +#include "PieChart.hxx" +#include "PlottingPositionHelper.hxx" +#include "ShapeFactory.hxx" +//#include "chartview/servicenames_charttypes.hxx" +//#include "chartview/servicenames_coosystems.hxx" +#include "CommonConverters.hxx" +#include "macros.hxx" +#include "Linear3DTransformation.hxx" +#include "ViewDefines.hxx" +#include "chartview/ObjectIdentifier.hxx" + +#ifndef _SV_GEN_HXX +#include <vcl/gen.hxx> +#endif +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif +#ifndef _TOOLS_COLOR_HXX +#include <tools/color.hxx> +#endif +#ifndef _SVX_UNOPRNMS_HXX +#include <svx/unoprnms.hxx> +#endif +#ifndef INCLUDED_RTL_MATH_HXX +#include <rtl/math.hxx> +#endif + + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +class PiePositionHelper : public PlottingPositionHelper +{ +public: + PiePositionHelper(); + virtual ~PiePositionHelper(); + + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation > + getTransformationLogicToScene( sal_Int32 nDim ) const; + + double getCatCount() const { + double fMin = getLogicMinX(); + double fMax = getLogicMaxX(); + //categories are defined to be at positive whole numbers only + if(fMax<0.0) + return 0.0; + if(fMin<0.0) + fMin=0.0; + //don't remove cast + return (long)(fMax - fMin)+1; } + + double getInnerRadius( double fCategoryX, bool& bIsVisible ) const; + double getOuterRadius( double fCategoryX ) const; + + DataPointGeometry transformLogicGeom( const DataPointGeometry& rGeom, sal_Int32 nDim ); + + double getStartCategoryIndex() const { + sal_Int32 nStart = getLogicMinX() + 0.5; + if( nStart < 0 ) + nStart = 0; + return nStart; + } + double getEndCategoryIndex() const { + sal_Int32 nEnd = getLogicMaxX() + 0.5; + if( nEnd < 0 ) + nEnd = 0; + return nEnd; + } + +private: //member + double m_fDepth; + + //Radius Offset for all rings in absolute logic values (1.0 == 1 category) + double m_fRingOffset; + + //Distance between different category rings, seen relative to width of a ring: + double m_fRingDistance; //>=0 m_fRingDistance=1 --> distance == width +}; + +PiePositionHelper::PiePositionHelper() + : m_fDepth(1.0) + , m_fRingOffset(0.5) + , m_fRingDistance(0.2) +{ +} + +PiePositionHelper::~PiePositionHelper() +{ +} + +double PiePositionHelper::getInnerRadius( double fCategoryX, bool& bIsVisible ) const +{ + bIsVisible = true; + double fRet = m_fRingOffset + fCategoryX-0.5+m_fRingDistance/(2.0*(1+m_fRingDistance)) - getLogicMinX(); + if(fRet<m_fRingOffset) + fRet=m_fRingOffset; + if(fRet>(m_fRingOffset+getLogicMaxX()-getLogicMinX())) + { + fRet=m_fRingOffset+getLogicMaxX()- getLogicMinX(); + bIsVisible = false; + } + doLogicScaling(&fRet,NULL,NULL); + return fRet; +} + +double PiePositionHelper::getOuterRadius( double fCategoryX ) const +{ + double fRet = m_fRingOffset + fCategoryX+0.5-m_fRingDistance/(2.0*(1+m_fRingDistance)) - getLogicMinX(); + if(fRet<m_fRingOffset) + fRet=m_fRingOffset; + if(fRet>(m_fRingOffset+getLogicMaxX()-getLogicMinX())) + fRet=m_fRingOffset+getLogicMaxX()- getLogicMinX(); + doLogicScaling(&fRet,NULL,NULL); + return fRet; +} + + +uno::Reference< XTransformation > PiePositionHelper::getTransformationLogicToScene( + sal_Int32 nDim ) const +{ + //transformation from 2) to 4) //@todo 2) and 4) need a ink to a document + + //?? need to apply this transformation to each geometric object, or would group be sufficient?? + + if( !m_xTransformationLogicToScene.is() ) + { + double fLogicDiameter = 2*(getLogicMaxX() - getLogicMinX() + m_fRingOffset); + + Matrix4D aMatrix; + //the middle of the pie circle is the middle of the diagram + aMatrix.TranslateX(fLogicDiameter/2.0); + aMatrix.ScaleX(FIXED_SIZE_FOR_3D_CHART_VOLUME/fLogicDiameter); + + aMatrix.TranslateY(fLogicDiameter/2.0); + aMatrix.ScaleY(FIXED_SIZE_FOR_3D_CHART_VOLUME/fLogicDiameter); + + aMatrix.ScaleZ(FIXED_SIZE_FOR_3D_CHART_VOLUME/m_fDepth); + + if(nDim==2) + aMatrix = aMatrix*m_aMatrixScreenToScene; + + m_xTransformationLogicToScene = new Linear3DTransformation(Matrix4DToHomogenMatrix( aMatrix )); + } + return m_xTransformationLogicToScene; +} + +DataPointGeometry PiePositionHelper::transformLogicGeom( const DataPointGeometry& rGeom, sal_Int32 nDim ) +{ + uno::Reference< XTransformation > xTransformation = getTransformationLogicToScene( nDim ); + DataPointGeometry aTransformedGeom( rGeom ); + + /* + DataPointGeometry aLogicGeom( drawing::Position3D(0.0,0.0,0.0) + , drawing::Direction3D(fOuterXDiameter,fOuterYDiameter,fDepth) + , drawing::Direction3D(fInnerXDiameter,fStartAngleDegree,fWidthAngleDegree) ); + */ + aTransformedGeom.m_aPosition = SequenceToPosition3D( xTransformation->transform( Position3DToSequence(rGeom.m_aPosition) ) ); + + drawing::Position3D aLogicPos1; + drawing::Position3D aLogicPos2( aLogicPos1 ); + aLogicPos2.PositionX += rGeom.m_aSize2.DirectionX;//fInnerXDiameter; + aLogicPos2.PositionZ += rGeom.m_aSize.DirectionZ; + drawing::Position3D aLogicPos3( aLogicPos1 ); + aLogicPos3.PositionX += rGeom.m_aSize.DirectionX; //fOuterXDiameter; + aLogicPos3.PositionY += rGeom.m_aSize.DirectionY; //fOuterYDiameter; + + drawing::Position3D aTransformedPos1( SequenceToPosition3D( xTransformation->transform( Position3DToSequence(aLogicPos1) ) ) ); + drawing::Position3D aTransformedPos2( SequenceToPosition3D( xTransformation->transform( Position3DToSequence(aLogicPos2) ) ) ); + drawing::Position3D aTransformedPos3( SequenceToPosition3D( xTransformation->transform( Position3DToSequence(aLogicPos3) ) ) ); + + + double fTransformedInnerXDiameter = aTransformedPos2.PositionX - aTransformedPos1.PositionX; + double fTransformedOuterXDiameter = aTransformedPos3.PositionX - aTransformedPos1.PositionX; + double fTransformedOuterYDiameter = aTransformedPos3.PositionY - aTransformedPos1.PositionY; + double fTransformedDepth = aTransformedPos2.PositionZ - aTransformedPos1.PositionZ; + + aTransformedGeom.m_aSize2.DirectionX = fTransformedInnerXDiameter; + aTransformedGeom.m_aSize.DirectionX = fTransformedOuterXDiameter; + aTransformedGeom.m_aSize.DirectionY = fTransformedOuterYDiameter; + aTransformedGeom.m_aSize.DirectionZ = fTransformedDepth; + + return aTransformedGeom; +} + + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +PieChart::PieChart( sal_Int32 nDimension ) + : VSeriesPlotter( nDimension ) + , m_pPosHelper( new PiePositionHelper() ) +{ + PlotterBase::m_pPosHelper = m_pPosHelper; +} + +PieChart::~PieChart() +{ + delete m_pPosHelper; +} + +//----------------------------------------------------------------- +// lang::XServiceInfo +//----------------------------------------------------------------- +/* +APPHELPER_XSERVICEINFO_IMPL(PieChart,CHART2_VIEW_PIECHART_SERVICE_IMPLEMENTATION_NAME) + + uno::Sequence< rtl::OUString > PieChart +::getSupportedServiceNames_Static() +{ + uno::Sequence< rtl::OUString > aSNS( 1 ); + aSNS.getArray()[ 0 ] = CHART2_VIEW_PIECHART_SERVICE_NAME; + return aSNS; +} +*/ + +/* +//----------------------------------------------------------------- +// chart2::XPlotter +//----------------------------------------------------------------- + + ::rtl::OUString SAL_CALL PieChart +::getCoordinateSystemTypeID() + throw (uno::RuntimeException) +{ + return CHART2_COOSYSTEM_CARTESIAN2D_SERVICE_NAME; +} + + void SAL_CALL PieChart +::setScales( const uno::Sequence< ExplicitScaleData >& rScales ) throw (uno::RuntimeException) +{ +} + void SAL_CALL PieChart +::setTransformation( const uno::Reference< XTransformation >& xTransformationToLogicTarget, const uno::Reference< XTransformation >& xTransformationToFinalPage ) throw (uno::RuntimeException) +{ +} +*/ + + +uno::Reference< drawing::XShape > PieChart::createDataPoint2D( + const uno::Reference< drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , const uno::Reference< beans::XPropertySet >& xObjectProperties ) +{ + uno::Reference< drawing::XShape > xShape = + m_pShapeFactory->createPieSegment2D( xTarget, rGeometry ); + + this->setMappedProperties( xShape, xObjectProperties, m_aShapePropertyMapForArea ); + return xShape; +} + +uno::Reference< drawing::XShape > PieChart::createDataPoint3D( + const uno::Reference< drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , const uno::Reference< beans::XPropertySet >& xObjectProperties ) +{ + uno::Reference< drawing::XShape > xShape = + m_pShapeFactory->createPieSegment( xTarget, rGeometry ); + + this->setMappedProperties( xShape, xObjectProperties, m_aShapePropertyMapForArea ); + return xShape; +} + +void PieChart::addSeries( VDataSeries* pSeries, sal_Int32 xSlot, sal_Int32 ySlot ) +{ + VSeriesPlotter::addSeries( pSeries, 0, ySlot ); +} + +void PieChart::createShapes() +{ + DBG_ASSERT(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is(),"PieChart is not proper initialized"); + if(!(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is())) + return; + + //--------------------------------------------- + //check necessary here that different Y axis can not be stacked in the same group? ... hm? + + //update/create information for current group + double fLogicZ = 0.0;//as defined + + //(@todo maybe different iteration for breaks in axis ?) + sal_Int32 nStartCategoryIndex = m_pPosHelper->getStartCategoryIndex(); // inclusive + sal_Int32 nEndCategoryIndex = m_pPosHelper->getEndCategoryIndex(); //inclusive +//============================================================================= + //iterate through all shown categories + for( sal_Int32 nCatIndex = nStartCategoryIndex; nCatIndex <= nEndCategoryIndex; nCatIndex++ ) + { + ::std::vector< VDataSeriesGroup >::iterator aXSlotIter = m_aXSlots.begin(); + const ::std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = m_aXSlots.end(); +//============================================================================= + //for the pie chart there should be at most one x slot per category (one ring is one x slot and there is only one ring per category) + if( aXSlotIter != aXSlotEnd ) + { + ::std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector); + + ::std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin(); + const ::std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end(); + + double fLogicYForNextSeries = 0.0; + + double fLogicYSum = 0.0; + for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ ) + { + double fY = (*aSeriesIter)->getY( nCatIndex ); + if(fY<0.0) + { + //@todo warn somehow that negative values are treated as positive + continue; + } + if( ::rtl::math::isNan(fY) ) + continue; + fLogicYSum += fabs(fY); + } + if(fLogicYSum==0.0) + continue; + aSeriesIter = pSeriesList->begin(); + + bool bIsVisible; + double fInnerXRadius = m_pPosHelper->getInnerRadius( (double)nCatIndex, bIsVisible ); + if( !bIsVisible ) + continue; + double fOuterXRadius = m_pPosHelper->getOuterRadius( (double)nCatIndex ); + double fOuterYRadius = fOuterXRadius; + //the radii are already clipped and had scaling now + + double fDepth = 1.0; +//============================================================================= + //iterate through all series in this x slot (in this ring) + for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ ) + { + uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShape(*aSeriesIter, m_xLogicTarget); + //collect data point information (logic coordinates, style ): + double fLogicYValue = fabs((*aSeriesIter)->getY( nCatIndex )); + if( ::rtl::math::isNan(fLogicYValue) ) + continue; + if(fLogicYValue==0.0)//@todo: continue also if the resolution to small + continue; + double fLogicYPos = fLogicYForNextSeries; + fLogicYForNextSeries += fLogicYValue; + + rtl::OUString aPointCID = ObjectIdentifier::createPointCID( + (*aSeriesIter)->getPointCID_Stub(), nCatIndex ); + //each subsystem may add an additional shape to form the whole point + //create a group shape for this point and add to the series shape: + uno::Reference< drawing::XShapes > xPointGroupShape_Shapes( + createGroupShape(xSeriesGroupShape_Shapes,aPointCID) ); + uno::Reference<drawing::XShape> xPointGroupShape_Shape = + uno::Reference<drawing::XShape>( xPointGroupShape_Shapes, uno::UNO_QUERY ); + + //iterate through all subsystems to create partial points + { + //clip logic coordinates: + //check fLogicX only necessary if we will allow breaks in category axes (see above for-loop) + //check fLogicZ hm ... + //check fLogicYValue get Y-scale for this series/stack group + //@todo fLogicYValue =... fInnerRadius = ... + + //---------------------------------- + double fStartAngleDegree = fLogicYPos/fLogicYSum*360.0; + double fWidthAngleDegree = fLogicYValue/fLogicYSum*360.0; + + DataPointGeometry aLogicGeom( drawing::Position3D(0.0,0.0,0.0) + , drawing::Direction3D(2.0*fOuterXRadius,2.0*fOuterYRadius,fDepth) + , drawing::Direction3D(2.0*fInnerXRadius,fStartAngleDegree,fWidthAngleDegree) ); + + //@todo: consider scaling here (transformation logic to logic) + //assumed scaling here: linear + + //transformation 3) -> 4) + DataPointGeometry aTransformedGeom( m_pPosHelper->transformLogicGeom(aLogicGeom, m_nDimension) ); + + if(m_nDimension==3) + { + uno::Reference< drawing::XShape > xShape = createDataPoint3D( + xPointGroupShape_Shapes + , aTransformedGeom + ,(*aSeriesIter)->getPropertiesOfPoint( nCatIndex )); + } + else //m_nDimension!=3 + { + uno::Reference< drawing::XShape > xShape = createDataPoint2D( + xPointGroupShape_Shapes + , aTransformedGeom + ,(*aSeriesIter)->getPropertiesOfPoint( nCatIndex )); + } + } + + //remove PointGroupShape if empty + if(!xPointGroupShape_Shapes->getCount()) + xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shape); + + }//next series in x slot (next y slot) + }//next x slot + }//next category +//============================================================================= +//============================================================================= +//============================================================================= + /* @todo remove series shapes if empty + //remove and delete point-group-shape if empty + if(!xSeriesGroupShape_Shapes->getCount()) + { + (*aSeriesIter)->m_xShape.set(NULL); + m_xLogicTarget->remove(xSeriesGroupShape_Shape); + } + */ + + //remove and delete series-group-shape if empty + + //... todo +} + +//e.g. for Rectangle +/* +uno::Reference< drawing::XShape > PieChart::createPartialPointShape( + CooPoint + series dependent properties ...(create a special struct for each chart type) + , uno::Reference< XThinCoordinateSystem > xCoo + , sal_Bool bIsInBreak + , PointStyle* pStyle ) +{ + //create one here; use scaling and transformation to logic target + + //maybe do not show anything in the break //maybe read the behavior out of the configuration + //if(bIsInBreak) + // return NULL; + + uno::Reference< drawing::XShape > xNewPartialPointShape( + m_xShapeFactory->createInstance( + rtl::OUString::createFromAscii( "com.sun.star.drawing.RectangleShape" ) ) + , uno::UNO_QUERY ); + //set size and position + { + // + } + if(pStyle||bIsInBreak) + { + //set style properties if any for a single point + uno::Reference< beans::XPropertySet > xProp( xNewPartialPointShape, uno::UNO_QUERY ); + xProp->setPropertyValue( ... ); + + //set special properties if point in break (e.g. additional transparency ...) + } +} + +//e.g. for PieChart in 2 dim cartesian coordinates: +sal_Bool ShapeFactory::isShown( const Sequence< ExplicitScaleData >& rScales, const CooPoint& rP, double dLogicalWidthBeforeScaling ) +{ + ASSERT(rScales.getLength()==2) + double dMin_x = rScales[0].Minimum; + double dMax_x = rScales[0].Maximum; + double dMin_y = rScales[1].Minimum; + double dMax_y = rScales[1].Maximum; + + //we know that we have cartesian geometry + Rectangle aSysRect( rScales[0].Minimum, rScales[1].Maximum, rScales[0].Maximum, rScales[1].Minimum ); + Rectangle aPointRect( dLogicalWidthBeforeScaling ) + if(rP) +} + +//----------------------------------------------------------------------------- + +class FatCoordinateSystem +{ +public: + //XCoordinateSystemType getType(); + Sequence<XThinCoordinateSystem> getCoordinateSystems(); +} + +class ThinCoordinateSystem +{ +private: + +public: + sal_Bool isBreak(); + Sequence< ExplicitScaleData > getScales();//SubScales without beak + + +} +*/ +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/charttypes/PieChart.hxx b/chart2/source/view/charttypes/PieChart.hxx new file mode 100644 index 000000000000..4ca239731a7c --- /dev/null +++ b/chart2/source/view/charttypes/PieChart.hxx @@ -0,0 +1,63 @@ +#ifndef _CHART2_PIECHART_HXX +#define _CHART2_PIECHART_HXX + +#include "VSeriesPlotter.hxx" +#include "DatapointGeometry.hxx" + +//............................................................................. +namespace chart +{ +//............................................................................. +class PiePositionHelper; + +class PieChart : public VSeriesPlotter +{ + //------------------------------------------------------------------------- + // public methods + //------------------------------------------------------------------------- +public: + PieChart( sal_Int32 nDimension ); + virtual ~PieChart(); + + //------------------------------------------------------------------------- + // chart2::XPlotter + //------------------------------------------------------------------------- + + virtual void SAL_CALL createShapes(); + /* + virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setScales( const ::com::sun::star::uno::Sequence< ::drafts::com::sun::star::chart2::ExplicitScaleData >& rScales ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException); + */ + + virtual void addSeries( VDataSeries* pSeries, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 ); + + //------------------------------------------------------------------------- + //------------------------------------------------------------------------- + //------------------------------------------------------------------------- +private: //methods + //no default constructor + PieChart(); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createDataPoint3D( + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet >& xObjectProperties ); + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createDataPoint2D( + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet >& xObjectProperties ); + +private: //member + PiePositionHelper* m_pPosHelper; +}; +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx new file mode 100644 index 000000000000..7bee4e083a3d --- /dev/null +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -0,0 +1,496 @@ +#include "VSeriesPlotter.hxx" +#include "ShapeFactory.hxx" + +#include "CommonConverters.hxx" +#include "macros.hxx" +#include "ViewDefines.hxx" +#include "chartview/ObjectIdentifier.hxx" + +//only for creation: @todo remove if all plotter are uno components and instanciated via servicefactory +#include "BarChart.hxx" +#include "PieChart.hxx" +#include "AreaChart.hxx" +// + +#ifndef _SVX_UNOPRNMS_HXX +#include <svx/unoprnms.hxx> +#endif + +#ifndef _TOOLS_COLOR_HXX +#include <tools/color.hxx> +#endif +// header for class OUStringBuffer +#ifndef _RTL_USTRBUF_HXX_ +#include <rtl/ustrbuf.hxx> +#endif +#ifndef INCLUDED_RTL_MATH_HXX +#include <rtl/math.hxx> +#endif +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +VDataSeriesGroup::VDataSeriesGroup() + : m_aSeriesVector() + , m_bSumValuesDirty(true) + , m_fPositiveSum(0.0) + , m_fNegativeSum(0.0) + , m_bMaxPointCountDirty(true) + , m_nMaxPointCount(0) + +{ +} + +VDataSeriesGroup::VDataSeriesGroup( VDataSeries* pSeries ) + : m_aSeriesVector(1,pSeries) + , m_bSumValuesDirty(true) + , m_fPositiveSum(0.0) + , m_fNegativeSum(0.0) + , m_bMaxPointCountDirty(true) + , m_nMaxPointCount(0) +{ +} + +VDataSeriesGroup::VDataSeriesGroup( const ::std::vector< VDataSeries* >& rSeriesVector ) + : m_aSeriesVector(rSeriesVector) + , m_bSumValuesDirty(true) + , m_fPositiveSum(0.0) + , m_fNegativeSum(0.0) + , m_bMaxPointCountDirty(true) + , m_nMaxPointCount(0) +{ +} +VDataSeriesGroup::~VDataSeriesGroup() +{ +} + +void VDataSeriesGroup::deleteSeries() +{ + //delete all data series help objects: + ::std::vector< VDataSeries* >::const_iterator aIter = m_aSeriesVector.begin(); + const ::std::vector< VDataSeries* >::const_iterator aEnd = m_aSeriesVector.end(); + for( ; aIter != aEnd; aIter++ ) + { + delete *aIter; + } + m_aSeriesVector.clear(); +} + +void VDataSeriesGroup::addSeries( VDataSeries* pSeries ) +{ + m_aSeriesVector.push_back(pSeries); + m_bSumValuesDirty=true; + m_bMaxPointCountDirty=true; +} + +sal_Int32 VDataSeriesGroup::getSeriesCount() const +{ + return m_aSeriesVector.size(); +} + +void VDataSeriesGroup::setSums( double fPositiveSum, double fNegativeSum ) +{ + m_fPositiveSum = fPositiveSum; + m_fNegativeSum = fNegativeSum; + m_bSumValuesDirty = false; +} + +bool VDataSeriesGroup::getSums( double& rfPositiveSum, double& rfNegativeSum ) const +{ + if(m_bSumValuesDirty) + return false; + rfPositiveSum = m_fPositiveSum; + rfNegativeSum = m_fNegativeSum; + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +VSeriesPlotter::VSeriesPlotter( sal_Int32 nDimension ) + : PlotterBase( nDimension ) + , m_aXSlots() +{ +} + +VSeriesPlotter::~VSeriesPlotter() +{ + //delete all data series help objects: + ::std::vector< VDataSeriesGroup >::iterator aXSlotIter = m_aXSlots.begin(); + const ::std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = m_aXSlots.end(); + for( ; aXSlotIter != aXSlotEnd; aXSlotIter++ ) + { + aXSlotIter->deleteSeries(); + } + m_aXSlots.clear(); +} + +//shape property -- chart model object property +tMakePropertyNameMap VSeriesPlotter::m_aShapePropertyMapForArea = + tMakePropertyNameMap + //area properties + ( C2U( UNO_NAME_FILLSTYLE ), C2U("FillStyle") ) + ( C2U( UNO_NAME_FILLCOLOR ), C2U("Color") ) + ( C2U(UNO_NAME_FILLGRADIENT), C2U("Gradient") ) + ( C2U(UNO_NAME_FILL_TRANSPARENCE), C2U("Transparency") ) + ( C2U("FillTransparenceGradient"), C2U("TransparencyGradient") ) + ( C2U(UNO_NAME_FILLHATCH), C2U("Hatch") ) + //line properties + ( C2U(UNO_NAME_LINESTYLE), C2U("BorderStyle") ) + ( C2U(UNO_NAME_LINECOLOR), C2U("BorderColor") ) + ( C2U(UNO_NAME_LINEWIDTH), C2U("BorderWidth") ) + ( C2U(UNO_NAME_LINEDASH), C2U("BorderDash") ) + ( C2U(UNO_NAME_LINETRANSPARENCE), C2U("BorderTransparency") ) + ; + +void VSeriesPlotter::addSeries( VDataSeries* pSeries, sal_Int32 xSlot,sal_Int32 ySlot ) +{ + //take ownership of pSeries + + DBG_ASSERT( pSeries, "series to add is NULL" ); + if(!pSeries) + return; + + if(xSlot<0 || xSlot>=static_cast<sal_Int32>(m_aXSlots.size())) + { + //append the series to already existing x series + m_aXSlots.push_back( VDataSeriesGroup(pSeries) ); + } + else + { + //x slot is already occupied + //y slot decides what to do: + + VDataSeriesGroup& rYSlots = m_aXSlots[xSlot]; + sal_Int32 nYSlotCount = rYSlots.getSeriesCount(); + + if( ySlot < -1 ) + { + //move all existing series in the xSlot to next slot + //@todo + DBG_ASSERT(0,"Not implemented yet"); + } + else if( ySlot == -1 || ySlot >= nYSlotCount) + { + //append the series to already existing y series + rYSlots.addSeries(pSeries); + } + else + { + //y slot is already occupied + //insert at given y and x position + + //@todo + DBG_ASSERT(0,"Not implemented yet"); + } + } +} + +uno::Reference< drawing::XShapes > VSeriesPlotter::getSeriesGroupShape( VDataSeries* pDataSeries + , const uno::Reference< drawing::XShapes >& xTarget ) +{ + if(pDataSeries->m_xShape.is()) + { + return uno::Reference<drawing::XShapes>( pDataSeries->m_xShape, uno::UNO_QUERY ); + } + + //create a group shape for this series and add to logic target: + uno::Reference< drawing::XShapes > xShapes( + createGroupShape( xTarget,pDataSeries->getCID() )); + uno::Reference<drawing::XShape> xShape = + uno::Reference<drawing::XShape>( xShapes, uno::UNO_QUERY ); + pDataSeries->m_xShape.set(xShape); + return xShapes; +} + +uno::Reference< drawing::XShapes > VSeriesPlotter::getLabelsGroupShape( VDataSeries* pDataSeries + , const uno::Reference< drawing::XShapes >& xTarget ) +{ + if(pDataSeries->m_xLabelsShape.is()) + { + return uno::Reference<drawing::XShapes>( pDataSeries->m_xLabelsShape, uno::UNO_QUERY ); + } + //create a group shape for this series and add to logic target: + uno::Reference< drawing::XShapes > xShapes( + createGroupShape( xTarget,pDataSeries->getLabelsCID() )); + uno::Reference<drawing::XShape> xShape = + uno::Reference<drawing::XShape>( xShapes, uno::UNO_QUERY ); + pDataSeries->m_xLabelsShape.set(xShape); + return xShapes; + +} + +void VSeriesPlotter::createDataLabel( const uno::Reference< drawing::XShapes >& xTarget + , const VDataSeries& rDataSeries + , sal_Int32 nPointIndex + , double fValue + , double fSumValue + , const awt::Point& rScreenPosition2D ) +{ + //check wether the label needs to be created and how: + DataCaptionStyle* pCaption = rDataSeries.getDataCaptionStyle( nPointIndex ); + + if( !pCaption || (!pCaption->ShowNumber && !pCaption->ShowNumberInPercent + && !pCaption->ShowCategoryName && !pCaption->ShowLegendSymbol ) ) + return; + + //------------------------------------------------ + //prepare text + ::rtl::OUStringBuffer aText; + { + if(pCaption->ShowNumberInPercent) + { + fValue = fValue*100.0/fSumValue; + sal_Int32 nRound = fValue*100; + fValue = nRound/100.0; + if( fValue < 0 ) + fValue*=-1.0; + } + if(pCaption->ShowCategoryName) + aText.append( rDataSeries.getCategoryString(nPointIndex) ); + + if(pCaption->ShowNumber || pCaption->ShowNumberInPercent) + { + if(aText.getLength()) + aText.append(sal_Unicode(' ')); + + //@todo as default use numberformat and formatter from calc fro this range + sal_Unicode cDecSeparator = '.';//@todo get this locale dependent + aText.append( ::rtl::math::doubleToUString( fValue + , rtl_math_StringFormat_G //rtl_math_StringFormat + , 3// DecPlaces + , cDecSeparator + //,sal_Int32 const * pGroups + //,sal_Unicode cGroupSeparator + ,false //bEraseTrailingDecZeros + ) ); + } + if(pCaption->ShowNumberInPercent) + aText.append(sal_Unicode('%')); + } + //------------------------------------------------ + //prepare properties for multipropertyset-interface of shape + tNameSequence* pPropNames; + tAnySequence* pPropValues; + if( !rDataSeries.getTextLabelMultiPropertyLists( nPointIndex, pPropNames, pPropValues ) ) + return; + uno::Any* pCIDAny = PropertyMapper::getValuePointer(*pPropValues,*pPropNames,C2U("Name")); + if(pCIDAny) + { + rtl::OUString aCID = ObjectIdentifier::createPointCID( rDataSeries.getLabelCID_Stub(),nPointIndex ); + *pCIDAny = uno::makeAny(aCID); + } + //------------------------------------------------ + + //create text shape + uno::Reference< drawing::XShape > xTextShape = ShapeFactory(m_xShapeFactory). + createText( xTarget, aText.makeStringAndClear() + , *pPropNames, *pPropValues + , ShapeFactory::makeTransformation( rScreenPosition2D ) ); +} + +void VSeriesPlotter::setMappedProperties( + const uno::Reference< drawing::XShape >& xTargetShape + , const uno::Reference< beans::XPropertySet >& xSource + , const tPropertyNameMap& rMap ) +{ + uno::Reference< beans::XPropertySet > xTargetProp( xTargetShape, uno::UNO_QUERY ); + PropertyMapper::setMappedProperties(xTargetProp,xSource,rMap); +} + +//------------------------------------------------------------------------- +// MinimumAndMaximumSupplier +//------------------------------------------------------------------------- + +double VSeriesPlotter::getMinimumX() +{ + //this is the default for all category charts + //@todo for other types + return -0.5; +} +double VSeriesPlotter::getMaximumX() +{ + //this is the default for all category charts + //@todo for other types + + //return category count + sal_Int32 nPointCount = getPointCount( m_aXSlots ); + return nPointCount-0.5; +} + +double VSeriesPlotter::getMinimumYInRange( double fMinimumX, double fMaximumX ) +{ + double fMinimum, fMaximum; + ::rtl::math::setInf(&fMinimum, false); + ::rtl::math::setInf(&fMaximum, true); + for(sal_Int32 nN =0; nN<m_aXSlots.size();nN++ ) + { + double fLocalMinimum, fLocalMaximum; + if( m_aXSlots[nN].calculateYMinAndMaxForCategoryRange( + static_cast<sal_Int32>(fMinimumX+0.5) + , static_cast<sal_Int32>(fMaximumX+0.5) + , fLocalMinimum, fLocalMaximum ) ) + { + if(fMaximum<fLocalMaximum) + fMaximum=fLocalMaximum; + if(fMinimum>fLocalMinimum) + fMinimum=fLocalMinimum; + } + } + if(::rtl::math::isInf(fMinimum)) + ::rtl::math::setNan(&fMinimum); + return fMinimum; +} + +double VSeriesPlotter::getMaximumYInRange( double fMinimumX, double fMaximumX ) +{ + double fMinimum, fMaximum; + ::rtl::math::setInf(&fMinimum, false); + ::rtl::math::setInf(&fMaximum, true); + for(sal_Int32 nN =0; nN<m_aXSlots.size();nN++ ) + { + double fLocalMinimum, fLocalMaximum; + if( m_aXSlots[nN].calculateYMinAndMaxForCategoryRange( + static_cast<sal_Int32>(fMinimumX+0.5) + , static_cast<sal_Int32>(fMaximumX+0.5) + , fLocalMinimum, fLocalMaximum ) ) + { + if(fMaximum<fLocalMaximum) + fMaximum=fLocalMaximum; + if(fMinimum>fLocalMinimum) + fMinimum=fLocalMinimum; + } + } + if(::rtl::math::isInf(fMaximum)) + ::rtl::math::setNan(&fMaximum); + return fMaximum; +} + +//static +sal_Int32 VSeriesPlotter::getPointCount( const ::std::vector< VDataSeriesGroup >& rSlots ) +{ + sal_Int32 nRet = 0; + + ::std::vector< VDataSeriesGroup >::const_iterator aXSlotIter = rSlots.begin(); + const ::std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = rSlots.end(); + + for( ; aXSlotIter != aXSlotEnd; aXSlotIter++ ) + { + sal_Int32 nPointCount = getPointCount( *aXSlotIter ); + if( nPointCount>nRet ) + nRet = nPointCount; + } + return nRet; +} + +//static +sal_Int32 VSeriesPlotter::getPointCount( const VDataSeriesGroup& rSeriesGroup ) +{ + sal_Int32 nRet = 0; + + const ::std::vector< VDataSeries* >* pSeriesList = &(rSeriesGroup.m_aSeriesVector); + + ::std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin(); + const ::std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end(); + + for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ ) + { + sal_Int32 nPointCount = (*aSeriesIter)->getTotalPointCount(); + if( nPointCount>nRet ) + nRet = nPointCount; + } + return nRet; +} + +void VDataSeriesGroup::calculateYSumsForCategory( sal_Int32 nCategoryIndex + , double& rfPositiveSum, double& rfNegativeSum ) +{ + //@todo maybe cach these values + + ::std::vector< VDataSeries* >* pSeriesList = &this->m_aSeriesVector; + + ::std::vector< VDataSeries* >::const_iterator aSeriesIter = pSeriesList->begin(); + const ::std::vector< VDataSeries* >::const_iterator aSeriesEnd = pSeriesList->end(); + + double fLogicPositiveYSum = 0.0; + double fLogicNegativeYSum = 0.0; + for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ ) + { + double fY = (*aSeriesIter)->getY( nCategoryIndex ); + if( ::rtl::math::isNan(fY) ) + continue; + if(fY>=0) + fLogicPositiveYSum+=fY; + else + fLogicNegativeYSum+=fY; + } + + rfPositiveSum = fLogicPositiveYSum; + rfNegativeSum = fLogicNegativeYSum; +} + +bool VDataSeriesGroup::calculateYMinAndMaxForCategoryRange( + sal_Int32 nStartCategoryIndex, sal_Int32 nEndCategoryIndex + , double& rfMinimum, double& rfMaximum ) +{ + //return true if valid values were found otherwise false + + //@todo maybe cache these values + ::rtl::math::setInf(&rfMinimum, false); + ::rtl::math::setInf(&rfMaximum, true); + + double fPositiveValue=0.0, fNegativeValue=0.0; + //iterate through the given categories + if(nStartCategoryIndex<0) + nStartCategoryIndex=0; + if(nEndCategoryIndex<0) + nEndCategoryIndex=0; + for( sal_Int32 nCatIndex = nStartCategoryIndex; nCatIndex < nEndCategoryIndex; nCatIndex++ ) + { + this->calculateYSumsForCategory( nCatIndex, fPositiveValue, fNegativeValue ); + if(rfMaximum<fPositiveValue) + rfMaximum=fPositiveValue; + if(rfMinimum>fNegativeValue) + rfMinimum=fNegativeValue; + } + return !::rtl::math::isInf( rfMinimum ) && !::rtl::math::isInf( rfMaximum ); +} + +//static +VSeriesPlotter* VSeriesPlotter::createSeriesPlotter( const rtl::OUString& rChartType, sal_Int32 nDimension ) +{ + //@todo: in future the plotter should be instanciated via service factory + VSeriesPlotter* pRet=NULL; + if( rChartType.equalsIgnoreAsciiCase(C2U("com.sun.star.chart2.BarChart")) ) + pRet = new BarChart(nDimension); + else if( rChartType.equalsIgnoreAsciiCase(C2U("com.sun.star.chart2.AreaChart")) ) + pRet = new AreaChart(nDimension); + else if( rChartType.equalsIgnoreAsciiCase(C2U("com.sun.star.chart2.PieChart")) ) + pRet = new PieChart(nDimension); + else + { + //@todo create other charttypes + //com.sun.star.chart2.LineChart? + //com.sun.star.chart2.NetChart? + //com.sun.star.chart2.ScatterChart? + pRet = new BarChart(nDimension); + } + + return pRet; +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/charttypes/makefile.mk b/chart2/source/view/charttypes/makefile.mk new file mode 100644 index 000000000000..c5d53fcdedf0 --- /dev/null +++ b/chart2/source/view/charttypes/makefile.mk @@ -0,0 +1,86 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ= ..$/..$/.. +PRJINC= $(PRJ)$/source +PRJNAME= chart2 +TARGET= chvtypes + +ENABLE_EXCEPTIONS= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: settings.mk + +# --- export library ------------------------------------------------- + +#object files to build and link together to lib $(SLB)$/$(TARGET).lib +SLOFILES = $(SLO)$/TransformationHelper.obj \ + $(SLO)$/CategoryPositionHelper.obj \ + $(SLO)$/VSeriesPlotter.obj \ + $(SLO)$/BarChart.obj \ + $(SLO)$/PieChart.obj \ + $(SLO)$/AreaChart.obj + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx new file mode 100644 index 000000000000..9c485d60f8b2 --- /dev/null +++ b/chart2/source/view/diagram/VDiagram.cxx @@ -0,0 +1,562 @@ +/************************************************************************* + * + * $RCSfile: VDiagram.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "VDiagram.hxx" +//#include "DebugHelper.hxx" +#include "PropertyMapper.hxx" +#include "CommonConverters.hxx" +#include "ViewDefines.hxx" +#include "Stripe.hxx" +#include "macros.hxx" + +#ifndef _SVX_UNOPRNMS_HXX +#include <svx/unoprnms.hxx> +#endif + +#ifndef _TOOLS_COLOR_HXX +#include <tools/color.hxx> +#endif + +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif + +#ifndef _COM_SUN_STAR_DRAWING_PROJECTIONMODE_HPP_ +#include <com/sun/star/drawing/ProjectionMode.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_SHADEMODE_HPP_ +#include <com/sun/star/drawing/ShadeMode.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +VDiagram::VDiagram( + const uno::Reference< XDiagram > & xDiagram, + sal_Int32 nDimension, sal_Bool bPolar ) + : m_xLogicTarget(NULL) + , m_xFinalTarget(NULL) + , m_xShapeFactory(NULL) + , m_pShapeFactory(NULL) + , m_xOuterGroupShape(NULL) + , m_xCoordinateRegionShape(NULL) + , m_oSceneMatrix() + , m_nDimension(nDimension) + , m_bPolar(bPolar) + , m_xDiagram(xDiagram) +{ + +} + +VDiagram::~VDiagram() +{ + delete m_pShapeFactory; +} + +void SAL_CALL VDiagram::init( + const uno::Reference< drawing::XShapes >& xLogicTarget + , const uno::Reference< drawing::XShapes >& xFinalTarget + , const uno::Reference< lang::XMultiServiceFactory >& xFactory ) +{ + DBG_ASSERT(xLogicTarget.is()&&xFinalTarget.is()&&xFactory.is(),"no proper initialization parameters"); + + m_xLogicTarget = xLogicTarget; + m_xFinalTarget = xFinalTarget; + m_xShapeFactory = xFactory; + m_pShapeFactory = new ShapeFactory(xFactory); +} + +void VDiagram::setSceneMatrix( const drawing::HomogenMatrix& rMatrix ) +{ + m_oSceneMatrix = rMatrix; +} + +void VDiagram::createShapes( const awt::Point& rPos, const awt::Size& rSize ) +{ + if( m_nDimension == 3 ) + createShapes_3d( rPos, rSize ); + else + createShapes_2d( rPos, rSize ); +} + +// const sal_Int32 nWallColor = 0xb0d8e8; //Color(COL_LIGHTGRAY).GetColor(); +// const sal_Int32 nWallColor = 0xf5fffa; // mint cream +// const sal_Int32 nWallColor = 0xc6e2ff; // SlateGray1 +const sal_Int32 nWallColor = 0xe0eeee; // azure2 +const sal_Int32 nWallTransparency = 90; + +namespace +{ +tPropertyNameMap & lcl_GetWallPropertyMap() +{ + static tPropertyNameMap aWallPropertyMap( + tMakePropertyNameMap + ( C2U( "FillStyle" ), C2U( "FillStyle" ) ) + ( C2U( "FillColor" ), C2U( "FillColor" ) ) + ( C2U( "FillTransparence" ), C2U( "FillTransparence" ) ) + ( C2U( "FillGradient" ), C2U( "FillGradient" ) ) + ( C2U( "FillHatch" ), C2U( "FillHatch" ) ) + ( C2U( "LineStyle" ), C2U( "LineStyle" ) ) + ( C2U( "LineWidth" ), C2U( "LineWidth" ) ) + ( C2U( "LineDash" ), C2U( "LineDash" ) ) + ( C2U( "LineColor" ), C2U( "LineColor" ) ) + ( C2U( "LineTransparence" ), C2U( "LineTransparence" ) ) + ( C2U( "LineJoint" ), C2U( "LineJoint" ) ) + ); + + return aWallPropertyMap; +}; +} // anonymous namespace + +void VDiagram::createShapes_2d( const awt::Point& rPos, const awt::Size& rSize ) +{ + DBG_ASSERT(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is()&&m_xShapeFactory.is(),"is not proper initialized"); + if(!(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is()&&m_xShapeFactory.is())) + return; + + //create group shape + uno::Reference< drawing::XShapes > xOuterGroup_Shapes = m_pShapeFactory->createGroup2D(m_xLogicTarget,C2U("CID/Diagram=XXX_CID"));//@todo read CID from model + m_xOuterGroupShape = uno::Reference<drawing::XShape>( xOuterGroup_Shapes, uno::UNO_QUERY ); + + //--------------------------- + //add back wall + { + uno::Reference< drawing::XShape > xShape2D( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.RectangleShape" ) ), uno::UNO_QUERY ); + xShape2D->setPosition(awt::Point(0,0)); + xShape2D->setSize(awt::Size(FIXED_SIZE_FOR_3D_CHART_VOLUME,FIXED_SIZE_FOR_3D_CHART_VOLUME)); + xOuterGroup_Shapes->add(xShape2D); + uno::Reference< beans::XPropertySet > xProp( xShape2D, uno::UNO_QUERY ); + if( xProp.is()) + { + try + { + if( m_xDiagram.is() ) + { + uno::Reference< beans::XPropertySet > xWallProp( m_xDiagram->getWall()); + if( xWallProp.is()) + PropertyMapper::setMappedProperties( xProp, xWallProp, lcl_GetWallPropertyMap() ); + } + else + { + DBG_ERROR( "Invalid Diagram model" ); + //Transparency + xProp->setPropertyValue( C2U( UNO_NAME_FILL_TRANSPARENCE ) + , uno::makeAny( (sal_Int16)nWallTransparency ) ); + //xProp->setPropertyValue( C2U( UNO_NAME_LINETRANSPARENCE ) + // , uno::makeAny( (sal_Int16)100 ) ); + + //FillColor + xProp->setPropertyValue( C2U( UNO_NAME_FILLCOLOR ) + , uno::makeAny(nWallColor) ); + } + + //CID for selection handling + xProp->setPropertyValue( C2U( UNO_NAME_MISC_OBJ_NAME ) + , uno::makeAny( C2U("CID/DiagramWall=XXX_CID") ) ); + } + catch( uno::Exception& e ) + { + e; + } + } + + } + //--------------------------- + + m_xOuterGroupShape->setPosition(rPos); + m_xOuterGroupShape->setSize(rSize); + + //create independent group shape as container for datapoints and such things + { + uno::Reference< drawing::XShapes > xShapes = m_pShapeFactory->createGroup2D(m_xLogicTarget,C2U("testonly;CooContainer=XXX_CID")); + m_xCoordinateRegionShape = uno::Reference<drawing::XShape>( xShapes, uno::UNO_QUERY ); + } +} + +void VDiagram::createShapes_3d( const awt::Point& rPos, const awt::Size& rSize ) +{ + DBG_ASSERT(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is()&&m_xShapeFactory.is(),"is not proper initialized"); + if(!(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is()&&m_xShapeFactory.is())) + return; + + //create shape + m_xOuterGroupShape = uno::Reference< drawing::XShape >( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.Shape3DSceneObject" ) ), uno::UNO_QUERY ); + m_xLogicTarget->add(m_xOuterGroupShape); + + //set properties + uno::Reference< beans::XPropertySet > xProp( m_xOuterGroupShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + //set TransformationMatrix + uno::Any aTM = uno::Any( &m_oSceneMatrix, ::getCppuType((const drawing::HomogenMatrix*)0) ); + + sal_Int32 nDistance = (sal_Int32)FIXED_SIZE_FOR_3D_CHART_VOLUME*8; //(FIXED_SIZE_FOR_3D_CHART_VOLUME * 4) / 6 + sal_Int32 nFocalLen = nDistance*3; + + try + { + xProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX ), aTM ); + //uno::Any aCG = createDefaultCameraGeometry(); + //xProp->setPropertyValue( C2U( UNO_NAME_3D_CAMERA_GEOMETRY ), aCG ); + xProp->setPropertyValue( C2U( UNO_NAME_3D_SCENE_DISTANCE ), uno::makeAny(nDistance) ); + xProp->setPropertyValue( C2U( UNO_NAME_3D_SCENE_FOCAL_LENGTH ), uno::makeAny(nFocalLen) ); + xProp->setPropertyValue( C2U( UNO_NAME_3D_SCENE_PERSPECTIVE ), uno::makeAny(drawing::ProjectionMode_PERSPECTIVE) ); //ProjectionMode_PARALLEL + + + //default is Light 1 on, but we want to use the Light 2 as in the old chart (Light 2 is not specular by default) + xProp->setPropertyValue( C2U( UNO_NAME_3D_SCENE_LIGHTON_1 ), uno::makeAny((sal_Bool)false) ); + xProp->setPropertyValue( C2U( UNO_NAME_3D_SCENE_LIGHTON_2 ), uno::makeAny((sal_Bool)true) ); + + //(204,204,204); + uno::Any aAnyLightColor_1 = xProp->getPropertyValue( C2U( UNO_NAME_3D_SCENE_LIGHTCOLOR_1 ) ); + uno::Any aAnyLightDirection_1 = xProp->getPropertyValue( C2U( UNO_NAME_3D_SCENE_LIGHTDIRECTION_1 ) ); + + sal_Int32 nLightColor_1; aAnyLightColor_1 >>= nLightColor_1; + drawing::Direction3D aLightDirection_1; aAnyLightDirection_1 >>= aLightDirection_1; + + xProp->setPropertyValue( C2U( UNO_NAME_3D_SCENE_LIGHTCOLOR_2 ), aAnyLightColor_1 ); + xProp->setPropertyValue( C2U( UNO_NAME_3D_SCENE_LIGHTDIRECTION_2 ), uno::makeAny(drawing::Direction3D(1,1,1)) ); + + xProp->setPropertyValue( C2U( UNO_NAME_3D_SCENE_SHADE_MODE ), uno::makeAny(drawing::ShadeMode_PHONG) ); //FLAT, PHONG, SMOOTH, DRAFT + + //UNO_NAME_3D_SCENE_DISTANCE D3DSceneDistance sal_Int32 + //UNO_NAME_3D_SCENE_FOCAL_LENGTH sal_Int32 + //UNO_NAME_3D_SCENE_PERSPECTIVE drawing::ProjectionMode + + //UNO_NAME_3D_SCENE_AMBIENTCOLOR sal_Int32 + //UNO_NAME_3D_SCENE_LIGHTCOLOR_1 sal_Int32 + //UNO_NAME_3D_SCENE_LIGHTDIRECTION_1 drawing::Direction3D + //UNO_NAME_3D_SCENE_LIGHTON_1 Bool + //UNO_NAME_3D_SCENE_SHADOW_SLANT sal_Int16 + //UNO_NAME_3D_SCENE_SHADE_MODE drawing::ShadeMode + //UNO_NAME_3D_SCENE_TWO_SIDED_LIGHTING Bool + + //test only - CID for selection handling + xProp->setPropertyValue( C2U( UNO_NAME_MISC_OBJ_NAME ) + , uno::makeAny( C2U("testonly;3DScene=XXX_CID") ) ); + } + catch( uno::Exception& e ) + { + e; + } + } + m_xOuterGroupShape->setPosition(rPos); //FIXED_SIZE_FOR_3D_CHART_VOLUME + m_xOuterGroupShape->setSize(rSize); //FIXED_SIZE_FOR_3D_CHART_VOLUME + + + uno::Reference< drawing::XShapes > xOuterGroup_Shapes = + uno::Reference<drawing::XShapes>( m_xOuterGroupShape, uno::UNO_QUERY ); + + + xOuterGroup_Shapes = m_pShapeFactory->createGroup3D( xOuterGroup_Shapes, C2U("CID/Diagram=XXX_CID") ); + + //------------------------------------------------------------------------- + //create additional group to manipulate the aspect ratio of the whole diagram: + /* + { + uno::Reference< beans::XPropertySet > xProp( xOuterGroup_Shapes, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + Matrix4D aM4; + double CatsFactor = 15.0;//@todo needs to be calculated from seriescount and slot distance ... + aM4.Scale(1.0, 1.0, 1.0/CatsFactor); + xProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX ) + , uno::makeAny(Matrix4DToHomogenMatrix(aM4)) ); + } + catch( uno::Exception& e ) + { + e; + } + } + } + */ + + //--------------------------- + + //add floor plate + { + uno::Reference< drawing::XShape > xShape = + m_pShapeFactory->createCube(xOuterGroup_Shapes, + DataPointGeometry( drawing::Position3D(FIXED_SIZE_FOR_3D_CHART_VOLUME/2.0,0,FIXED_SIZE_FOR_3D_CHART_VOLUME/2.0) + ,drawing::Direction3D(FIXED_SIZE_FOR_3D_CHART_VOLUME,FLOOR_THICKNESS,FIXED_SIZE_FOR_3D_CHART_VOLUME) ) + , ShapeAppearance( Color(COL_LIGHTGRAY).GetColor(), 0 ) ); + ShapeFactory::setShapeName( xShape, C2U("CID/DiagramFloor=XXX_CID") ); + } + + //add left wall + { + uno::Reference< drawing::XShape > xShape = + m_pShapeFactory->createStripe(xOuterGroup_Shapes + , Stripe( + drawing::Position3D(0,0,FIXED_SIZE_FOR_3D_CHART_VOLUME) + , drawing::Direction3D(0,0,-FIXED_SIZE_FOR_3D_CHART_VOLUME) + , drawing::Direction3D(0,FIXED_SIZE_FOR_3D_CHART_VOLUME,0) ) + , ShapeAppearance( nWallColor, nWallTransparency ) + , false ); + ShapeFactory::setShapeName( xShape, C2U("CID/DiagramWall=XXX_CID") ); + } + //add back wall + { + uno::Reference< drawing::XShape > xShape = + m_pShapeFactory->createStripe(xOuterGroup_Shapes + , Stripe( + drawing::Position3D(0,0,0) + , drawing::Direction3D(FIXED_SIZE_FOR_3D_CHART_VOLUME,0,0) + , drawing::Direction3D(0,FIXED_SIZE_FOR_3D_CHART_VOLUME,0) ) + , ShapeAppearance( nWallColor, nWallTransparency ) + , false ); + ShapeFactory::setShapeName( xShape, C2U("CID/DiagramWall=XXX_CID") ); + } + //--------------------------- + + //create an additional scene for the smaller inner coordinate region: + { + uno::Reference< drawing::XShapes > xShapes = m_pShapeFactory->createGroup3D( xOuterGroup_Shapes,C2U("testonly;CooContainer=XXX_CID") ); + m_xCoordinateRegionShape = uno::Reference< drawing::XShape >( xShapes, uno::UNO_QUERY ); + + uno::Reference< beans::XPropertySet > xProp( m_xCoordinateRegionShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + double fXScale = (FIXED_SIZE_FOR_3D_CHART_VOLUME -GRID_TO_WALL_DISTANCE) /FIXED_SIZE_FOR_3D_CHART_VOLUME; + double fYScale = (FIXED_SIZE_FOR_3D_CHART_VOLUME -FLOOR_THICKNESS ) /FIXED_SIZE_FOR_3D_CHART_VOLUME; + double fZScale = (FIXED_SIZE_FOR_3D_CHART_VOLUME -GRID_TO_WALL_DISTANCE) /FIXED_SIZE_FOR_3D_CHART_VOLUME; + + Matrix4D aM4; + aM4.Translate(GRID_TO_WALL_DISTANCE/fXScale, FLOOR_THICKNESS/fYScale, GRID_TO_WALL_DISTANCE/fZScale); + aM4.Scale( fXScale, fYScale, fZScale ); + xProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX ) + , uno::makeAny(Matrix4DToHomogenMatrix(aM4)) ); + } + catch( uno::Exception& e ) + { + e; + } + } + } + + //--------------------------- + {//only test + + //only test: create grey borders as replacement for axes + /* + uno::Reference< drawing::XShapes > xTarget( m_xCoordinateRegionShape, uno::UNO_QUERY ); + m_pShapeFactory->createCube(xTarget, + DataPointGeometry( drawing::Position3D(FIXED_SIZE_FOR_3D_CHART_VOLUME/2,0,FIXED_SIZE_FOR_3D_CHART_VOLUME-50) + ,drawing::Direction3D(FIXED_SIZE_FOR_3D_CHART_VOLUME,100,100) ) + , ShapeAppearance( Color(COL_LIGHTGRAY).GetColor() ) ); + m_pShapeFactory->createCube(xTarget, + DataPointGeometry( drawing::Position3D(50,0,FIXED_SIZE_FOR_3D_CHART_VOLUME/2) + ,drawing::Direction3D(100,100,FIXED_SIZE_FOR_3D_CHART_VOLUME) ) + , ShapeAppearance( Color(COL_LIGHTGRAY).GetColor() ) ); + m_pShapeFactory->createCube(xTarget, + DataPointGeometry( drawing::Position3D(50,0,FIXED_SIZE_FOR_3D_CHART_VOLUME-50) + ,drawing::Direction3D(100,FIXED_SIZE_FOR_3D_CHART_VOLUME,100) ) + , ShapeAppearance( Color(COL_LIGHTGRAY).GetColor() ) ); + m_pShapeFactory->createCube(xTarget, + DataPointGeometry( drawing::Position3D(50,0,50) + ,drawing::Direction3D(100,FIXED_SIZE_FOR_3D_CHART_VOLUME,100) ) + , ShapeAppearance( Color(COL_LIGHTGRAY).GetColor() ) ); + + m_pShapeFactory->createCube(xTarget, + DataPointGeometry( drawing::Position3D(FIXED_SIZE_FOR_3D_CHART_VOLUME-50,0,FIXED_SIZE_FOR_3D_CHART_VOLUME-50) + ,drawing::Direction3D(100,FIXED_SIZE_FOR_3D_CHART_VOLUME,100) ) + , ShapeAppearance( Color(COL_LIGHTGRAY).GetColor() ) ); + m_pShapeFactory->createCube(xTarget, + DataPointGeometry( drawing::Position3D(FIXED_SIZE_FOR_3D_CHART_VOLUME-50,0,50) + ,drawing::Direction3D(100,FIXED_SIZE_FOR_3D_CHART_VOLUME,100) ) + , ShapeAppearance( Color(COL_LIGHTGRAY).GetColor() ) ); + */ + } + +} + +uno::Reference< drawing::XShapes > VDiagram::getCoordinateRegion() +{ + return uno::Reference<drawing::XShapes>( m_xCoordinateRegionShape, uno::UNO_QUERY ); +} + + + + +/* +uno::Any createDefaultCameraGeometry( ) +{ + long nX = 0; + long nY = 0; + long nW = (long)FIXED_SIZE_FOR_3D_CHART_VOLUME; + long nH = (long)FIXED_SIZE_FOR_3D_CHART_VOLUME; + long nZ = (long)((FIXED_SIZE_FOR_3D_CHART_VOLUME * 4.0) / 6.0); + long nDepth = -nZ; +*/ + /* + //defaults: + double fFocalLen = 80.0; //UNO_NAME_3D_SCENE_FOCAL_LENGTH sal_Int32 + //UNO_NAME_3D_SCENE_AMBIENTCOLOR sal_Int32 + //UNO_NAME_3D_SCENE_PERSPECTIVE drawing::ProjectionMode + double fTiltAng = DEG2RAD(-(double)nZAngle / 10.0); + */ + +// drawing::CameraGeometry aRet; + // Vector3D aCamPosition(nX + nW/2, nH/2, nW/2); + // Vector3D aLookDirection(nX + nW/2, nH/2, nDepth/2) ; + //Vector3D aVUP; + + + /* + Vector3D aCamPosition(0, 0, 400); + Vector3D aLookDirection(0,0,1) ; + Vector3D aVUP(1,1,0); + */ +/* + Vector3D aCamPosition(0, 0, 0); + Vector3D aLookDirection(0,0,0) ; + Vector3D aVUP(0,0,0); + + aRet.vrp.PositionX = aCamPosition.X(); //ViewReferencePoint (Point on the View plane) + aRet.vrp.PositionY = aCamPosition.Y(); + aRet.vrp.PositionZ = aCamPosition.Z(); + aRet.vpn.DirectionX = aLookDirection.X(); //ViewPlaneNormal (Normal to the View Plane) + aRet.vpn.DirectionY = aLookDirection.Y(); + aRet.vpn.DirectionZ = aLookDirection.Z(); +*/ + //on the view plane there is a '3D viewing-reference coordinate (VCR) system' with VRP as origin + //and orthogonal axes n,v,u (v and u in the view plane) +/* aRet.vup.DirectionX = aVUP.X(); //view up vector; determines the v-axis direction on the view plane as projection of VUP parallel to VPN onto th view pane + aRet.vup.DirectionY = aVUP.Y(); + aRet.vup.DirectionZ = aVUP.Z(); +*/ + //a window is defined on the view plane with minimum and maximum v and u values + //...where to set via uno?? + +// return uno::Any(&aRet, ::getCppuType((const drawing::CameraGeometry*)0) ); + /* + -------------- + Camera3D aCam(pScene->GetCamera()); + Vector3D aCamPos(nX + nW/2, nH/2, nW/2); + Vector3D aLookAt(nX + nW/2, nH/2, nDepth/2); + aCam.SetViewWindow(-nW/2, -nH/2, nW, nH); + aCam.SetDefaults(aCamPos, aLookAt, 80, DEG2RAD(-(double)nZAngle / 10.0)); + //double fFocalLen = 35.0, double fBankAng = 0); + aCam.Reset(); + aCam.SetProjection(eProjection); + aCam.RotateAroundLookAt(DEG2RAD((double)nYAngle / 10.0), DEG2RAD((double)nXAngle / 10.0)); + aCam.SetAspectMapping(AS_HOLD_SIZE); + pScene->SetCamera(aCam); + -------------- + // copy lightsource 1 (Base3DLight0) to lightsource 2 + // color + SetItem( Svx3DLightcolor2Item( GetLightGroup().GetIntensity( Base3DMaterialDiffuse, Base3DLight0 ))); + // direction + SetItem( Svx3DLightDirection2Item( GetLightGroup().GetDirection( Base3DLight0 ))); + + // enable light source 2 + SetItem( Svx3DLightOnOff2Item( TRUE )); + // disable light source 1 + SetItem( Svx3DLightOnOff1Item( FALSE )); + */ +//} + + +/* +void DebugHelper_ShowSceneProperties(uno::Reference< drawing::XShape > xShape) +{ + drawing::HomogenMatrix aMatrix; + drawing::CameraGeometry aCamera; + sal_Int32 nDistance = 0; + sal_Int32 nFocalLen = 0; + drawing::ProjectionMode ePerspective; + + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + xProp->getPropertyValue( rtl::OUString::createFromAscii( UNO_NAME_3D_TRANSFORM_MATRIX ) ) + >>= aMatrix; + xProp->getPropertyValue( rtl::OUString::createFromAscii( UNO_NAME_3D_CAMERA_GEOMETRY ) ) + >>= aCamera; + xProp->getPropertyValue( rtl::OUString::createFromAscii( UNO_NAME_3D_SCENE_DISTANCE ) ) + >>= nDistance; + xProp->getPropertyValue( rtl::OUString::createFromAscii( UNO_NAME_3D_SCENE_FOCAL_LENGTH ) ) + >>= nFocalLen; + xProp->getPropertyValue( rtl::OUString::createFromAscii( UNO_NAME_3D_SCENE_PERSPECTIVE ) ) + >>= ePerspective; + } +} +*/ + +//............................................................................. +} //namespace chart +//............................................................................. + diff --git a/chart2/source/view/diagram/makefile.mk b/chart2/source/view/diagram/makefile.mk new file mode 100644 index 000000000000..4e694eb5faf9 --- /dev/null +++ b/chart2/source/view/diagram/makefile.mk @@ -0,0 +1,82 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ= ..$/..$/.. +PRJINC= $(PRJ)$/source +PRJNAME= chart2 +TARGET= chvdiagram + +ENABLE_EXCEPTIONS= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: settings.mk + +# --- export library ------------------------------------------------- + +#object files to build and link together to lib $(SLB)$/$(TARGET).lib +SLOFILES = $(SLO)$/VDiagram.obj + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk + diff --git a/chart2/source/view/exports.flt b/chart2/source/view/exports.flt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/chart2/source/view/exports.flt diff --git a/chart2/source/view/inc/Linear3DTransformation.hxx b/chart2/source/view/inc/Linear3DTransformation.hxx new file mode 100644 index 000000000000..7fe7bb652cf9 --- /dev/null +++ b/chart2/source/view/inc/Linear3DTransformation.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * $RCSfile: Linear3DTransformation.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2002 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART_LINEAR3DTRANSFORMATION_HXX +#define _CHART_LINEAR3DTRANSFORMATION_HXX + +#ifndef _CPPUHELPER_IMPLBASE1_HXX_ +#include <cppuhelper/implbase1.hxx> +#endif + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTRANSFORMATION_HPP_ +#include <drafts/com/sun/star/chart2/XTransformation.hpp> +#endif + +#ifndef _COM_SUN_STAR_DRAWING_HOMOGENMATRIX_HPP_ +#include <com/sun/star/drawing/HomogenMatrix.hpp> +#endif + +namespace chart +{ + +class Linear3DTransformation : public ::cppu::WeakImplHelper1< + ::drafts::com::sun::star::chart2::XTransformation + > +{ +public: + Linear3DTransformation( const ::com::sun::star::drawing::HomogenMatrix& rHomMatrix ); + virtual ~Linear3DTransformation(); + + // ____ XTransformation ____ + /// @see ::drafts::com::sun::star::chart2::XTransformation + virtual ::com::sun::star::uno::Sequence< double > SAL_CALL transform( + const ::com::sun::star::uno::Sequence< double >& rSourceValues ) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + /// @see ::drafts::com::sun::star::chart2::XTransformation + virtual sal_Int32 SAL_CALL getSourceDimension() + throw (::com::sun::star::uno::RuntimeException); + /// @see ::drafts::com::sun::star::chart2::XTransformation + virtual sal_Int32 SAL_CALL getTargetDimension() + throw (::com::sun::star::uno::RuntimeException); + +private: + ::com::sun::star::drawing::HomogenMatrix m_Matrix; +}; + +} // namespace chart + +// _CHART_LINEAR3DTRANSFORMATION_HXX +#endif + diff --git a/chart2/source/view/inc/PlotterBase.hxx b/chart2/source/view/inc/PlotterBase.hxx new file mode 100644 index 000000000000..739d34522190 --- /dev/null +++ b/chart2/source/view/inc/PlotterBase.hxx @@ -0,0 +1,175 @@ +/************************************************************************* + * + * $RCSfile: PlotterBase.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_PLOTTERBASE_HXX +#define _CHART2_PLOTTERBASE_HXX + +#ifndef _COM_SUN_STAR_DRAWING_HOMOGENMATRIX_HPP_ +#include <com/sun/star/drawing/HomogenMatrix.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_XSHAPES_HPP_ +#include <com/sun/star/drawing/XShapes.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif +#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_ +#include <com/sun/star/uno/XComponentContext.hpp> +#endif +/* +#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_ +#include <com/sun/star/lang/XComponent.hpp> +#endif +*/ + +//---- +#include <vector> + +//---- chart2 +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_EXPLICITSCALEDATA_HPP_ +#include <drafts/com/sun/star/chart2/ExplicitScaleData.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTRANSFORMATION_HPP_ +#include <drafts/com/sun/star/chart2/XTransformation.hpp> +#endif +/* +#ifndef _COM_SUN_STAR_CHART2_XPLOTTER_HPP_ +#include <drafts/com/sun/star/chart2/XPlotter.hpp> +#endif +*/ + +//---- +#ifndef _CPPUHELPER_IMPLBASE1_HXX_ +#include <cppuhelper/implbase1.hxx> +#endif + +#ifndef _B3D_HMATRIX_HXX +#include <goodies/hmatrix.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +class ShapeFactory; +class PlottingPositionHelper; + +class PlotterBase +{ +public: + PlotterBase( sal_Int32 nDimension ); + virtual ~PlotterBase(); + + // ___chart2::XPlotter___ + virtual void SAL_CALL init( + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xLogicTarget + , const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xFinalTarget + , const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory >& xFactory ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setScales( + const ::com::sun::star::uno::Sequence< + ::drafts::com::sun::star::chart2::ExplicitScaleData >& rScales ) + throw (::com::sun::star::uno::RuntimeException); + + void setTransformationSceneToScreen( const ::com::sun::star::drawing::HomogenMatrix& rMatrix ); + + virtual void SAL_CALL createShapes() = 0; + + /* + virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException); + */ + + //------------------------------------------------------------------------- + //------------------------------------------------------------------------- + //------------------------------------------------------------------------- +private: //methods + //no default constructor + PlotterBase(); + +protected: //methods + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > + createGroupShape( const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , const ::rtl::OUString& rName ); + +protected: //member + ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes > m_xLogicTarget; + ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes > m_xFinalTarget; + ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory> m_xShapeFactory; + ShapeFactory* m_pShapeFactory; + //::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xCC; + + sal_Int32 m_nDimension; + // needs to be created by the derived class + PlottingPositionHelper* m_pPosHelper; +}; +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/view/inc/PlottingPositionHelper.hxx b/chart2/source/view/inc/PlottingPositionHelper.hxx new file mode 100644 index 000000000000..4833de793b8c --- /dev/null +++ b/chart2/source/view/inc/PlottingPositionHelper.hxx @@ -0,0 +1,201 @@ +/************************************************************************* + * + * $RCSfile: PlottingPositionHelper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_PLOTTINGPOSITIONHELPER_HXX +#define _CHART2_PLOTTINGPOSITIONHELPER_HXX + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_EXPLICITSCALEDATA_HPP_ +#include <drafts/com/sun/star/chart2/ExplicitScaleData.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTRANSFORMATION_HPP_ +#include <drafts/com/sun/star/chart2/XTransformation.hpp> +#endif + +#ifndef _COM_SUN_STAR_DRAWING_HOMOGENMATRIX_HPP_ +#include <com/sun/star/drawing/HomogenMatrix.hpp> +#endif + +#ifndef _B3D_HMATRIX_HXX +#include <goodies/hmatrix.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +class PlottingPositionHelper +{ +public: + PlottingPositionHelper(); + virtual ~PlottingPositionHelper(); + + void setTransformationSceneToScreen( const ::com::sun::star::drawing::HomogenMatrix& rMatrix); + + void setScales( const ::com::sun::star::uno::Sequence< + ::drafts::com::sun::star::chart2::ExplicitScaleData >& rScales ); + + inline bool isLogicVisible( double fX, double fY, double fZ ) const; + inline void doLogicScaling( double* pX, double* pY, double* pZ ) const; + inline void clipLogicValues( double* pX, double* pY, double* pZ ) const; + + virtual ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XTransformation > + getTransformationLogicToScene() const; + + inline double getLogicMinX() const; + inline double getLogicMinY() const; + inline double getLogicMinZ() const; + inline double getLogicMaxX() const; + inline double getLogicMaxY() const; + inline double getLogicMaxZ() const; + + void getLogicMinimum( ::com::sun::star::uno::Sequence< double >& rSeq ) const; + void getLogicMaximum( ::com::sun::star::uno::Sequence< double >& rSeq ) const; + + void getScreenValuesForMinimum( ::com::sun::star::uno::Sequence< double >& rSeq ) const; + void getScreenValuesForMaximum( ::com::sun::star::uno::Sequence< double >& rSeq ) const; + +protected: //member + ::com::sun::star::uno::Sequence< + ::drafts::com::sun::star::chart2::ExplicitScaleData > m_aScales; + Matrix4D m_aMatrixScreenToScene; + + //this is calculated based on m_aScales and m_aMatrixScreenToScene + mutable ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XTransformation > m_xTransformationLogicToScene; +}; + +bool PlottingPositionHelper::isLogicVisible( + double fX, double fY, double fZ ) const +{ + return fX >= m_aScales[0].Minimum && fX <= m_aScales[0].Maximum + && fY >= m_aScales[1].Minimum && fY <= m_aScales[1].Maximum + && fZ >= m_aScales[2].Minimum && fZ <= m_aScales[2].Maximum; +} + +void PlottingPositionHelper::doLogicScaling( double* pX, double* pY, double* pZ ) const +{ + if(pX && m_aScales[0].Scaling.is()) + *pX = m_aScales[0].Scaling->doScaling(*pX); + if(pY && m_aScales[1].Scaling.is()) + *pY = m_aScales[1].Scaling->doScaling(*pY); + if(pZ && m_aScales[2].Scaling.is()) + *pZ = m_aScales[2].Scaling->doScaling(*pZ); +} + +void PlottingPositionHelper::clipLogicValues( double* pX, double* pY, double* pZ ) const +{ + if(pX) + { + if( *pX < m_aScales[0].Minimum ) + *pX = m_aScales[0].Minimum; + else if( *pX > m_aScales[0].Maximum ) + *pX = m_aScales[0].Maximum; + } + if(pY) + { + if( *pY < m_aScales[1].Minimum ) + *pY = m_aScales[1].Minimum; + else if( *pY > m_aScales[1].Maximum ) + *pY = m_aScales[1].Maximum; + } + if(pZ) + { + if( *pZ < m_aScales[2].Minimum ) + *pZ = m_aScales[2].Minimum; + else if( *pZ > m_aScales[2].Maximum ) + *pZ = m_aScales[2].Maximum; + } +} + +inline double PlottingPositionHelper::getLogicMinX() const +{ + return m_aScales[0].Minimum; +} +inline double PlottingPositionHelper::getLogicMinY() const +{ + return m_aScales[1].Minimum; +} +inline double PlottingPositionHelper::getLogicMinZ() const +{ + return m_aScales[2].Minimum; +} + +inline double PlottingPositionHelper::getLogicMaxX() const +{ + return m_aScales[0].Maximum; +} +inline double PlottingPositionHelper::getLogicMaxY() const +{ + return m_aScales[1].Maximum; +} +inline double PlottingPositionHelper::getLogicMaxZ() const +{ + return m_aScales[2].Maximum; +} + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/view/inc/PropertyMapper.hxx b/chart2/source/view/inc/PropertyMapper.hxx new file mode 100644 index 000000000000..638d9141ef45 --- /dev/null +++ b/chart2/source/view/inc/PropertyMapper.hxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * $RCSfile: PropertyMapper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_PROPERTYMAPPER_HXX +#define _CHART2_PROPERTYMAPPER_HXX + +#include "InlineContainer.hxx" + +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_XSHAPE_HPP_ +#include <com/sun/star/drawing/XShape.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +typedef ::std::map< ::rtl::OUString, ::rtl::OUString > tPropertyNameMap; +typedef ::comphelper::MakeMap< ::rtl::OUString, ::rtl::OUString > tMakePropertyNameMap; + +typedef ::std::map< ::rtl::OUString, ::com::sun::star::uno::Any > tPropertyNameValueMap; +typedef ::comphelper::MakeMap< ::rtl::OUString, ::com::sun::star::uno::Any > tMakePropertyNameValueMap; + +typedef ::com::sun::star::uno::Sequence< rtl::OUString > tNameSequence; +typedef ::comphelper::MakeSequence< rtl::OUString > tMakeNameSequence; + +typedef ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > tAnySequence; +typedef ::comphelper::MakeSequence< ::com::sun::star::uno::Any > tMakeAnySequence; + +class PropertyMapper +{ +public: + static void setMappedProperties( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet >& xTarget + , const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet >& xSource + , const tPropertyNameMap& rMap ); + + static void getValueMap( + tPropertyNameValueMap& rValueMap + , const tPropertyNameMap& rNameMap + , const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet >& xSourceProp + ); + + static void getMultiPropertyLists( + tNameSequence& rNames + , tAnySequence& rValues + , const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xProp + , const tPropertyNameMap& rMap + ); + + static void getMultiPropertyListsFromValueMap( + tNameSequence& rNames + , tAnySequence& rValues + , const tPropertyNameValueMap& rValueMap + ); + + static ::com::sun::star::uno::Any* + getValuePointer( tAnySequence& rPropValues + , const tNameSequence& rPropNames + , const rtl::OUString& rPropName ); + + static void setMultiProperties( + const tNameSequence& rNames + , const tAnySequence& rValues + , const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShape >& xTarget ); + + static const tMakePropertyNameMap& getPropertyNameMapForCharacterProperties(); + static const tMakePropertyNameMap& getPropertyNameMapForParagraphProperties(); + static const tMakePropertyNameMap& getPropertyNameMapForFillProperties(); + static const tMakePropertyNameMap& getPropertyNameMapForLineProperties(); + +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx new file mode 100644 index 000000000000..108d17c5a4bb --- /dev/null +++ b/chart2/source/view/inc/ShapeFactory.hxx @@ -0,0 +1,234 @@ +/************************************************************************* + * + * $RCSfile: ShapeFactory.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_VIEW_SHAPEFACTORY_HXX +#define _CHART2_VIEW_SHAPEFACTORY_HXX + +#include "DatapointGeometry.hxx" +#include "ShapeAppearance.hxx" +#include "PropertyMapper.hxx" + + +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_POINTSEQUENCESEQUENCE_HPP_ +#include <com/sun/star/drawing/PointSequenceSequence.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_POLYPOLYGONSHAPE3D_HPP_ +#include <com/sun/star/drawing/PolyPolygonShape3D.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_XSHAPES_HPP_ +#include <com/sun/star/drawing/XShapes.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +class Stripe; + +class ShapeFactory +{ +public: + ShapeFactory(::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> xFactory) + {m_xShapeFactory = xFactory;} + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > + createGroup2D( + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , ::rtl::OUString aName = ::rtl::OUString() ); + + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > + createGroup3D( + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , ::rtl::OUString aName = ::rtl::OUString() ); + + //------ + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createCube( const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , const ShapeAppearance& rAppearance ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createRoundedCube(const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createCylinder( const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createPyramid( const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createCone( const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createPieSegment( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createPieSegment2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createStripe( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget + , const Stripe& rStripe + , const ShapeAppearance& rAppearance + , sal_Bool bDoubleSided = true); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createArea3D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget + , const ::com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygon + , double fDepth); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createArea2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget + , const ::com::sun::star::drawing::PolyPolygonShape3D& rPolyPolygon); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createSymbol2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , const ShapeAppearance& rAppearance ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createSymbol3D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , const ShapeAppearance& rAppearance ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createLine2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget + , const ::com::sun::star::drawing::PointSequenceSequence& rPoints + , const LineProperties& rLineProperties ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createLine3D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget + , const ::com::sun::star::drawing::PolyPolygonShape3D& rPoints + , const LineProperties& rLineProperties ); + + //------------------- create 2D elements: + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + createText( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget2D + , const ::rtl::OUString& rText + , const tNameSequence& rPropNames + , const tAnySequence& rPropValues + , const ::com::sun::star::uno::Any& rATransformation + ); + + //------ + + static void setShapeAppearance( const ShapeAppearance& rAppearance + , const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet >& xProp + , sal_Bool bNoLines = true ) + throw (::com::sun::star::beans::UnknownPropertyException + , ::com::sun::star::beans::PropertyVetoException + , ::com::sun::star::lang::IllegalArgumentException + , ::com::sun::star::lang::WrappedTargetException + , ::com::sun::star::uno::RuntimeException); + + static void setShapeName( const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShape >& xShape + , const rtl::OUString& rName ); + + static ::com::sun::star::uno::Any makeTransformation( const ::com::sun::star::awt::Point& rScreenPosition2D, double fRotationAnglePi=0.0 ); + + static rtl::OUString getStackedString( const rtl::OUString& rString, bool bStacked=true ); + +private: + ShapeFactory(); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + impl_createCube( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , sal_Bool bRounded ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + impl_createConeOrCylinder( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , sal_Int32 nSegments + , bool bCylinder = false); + + //member: + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> + m_xShapeFactory; +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/view/inc/Stripe.hxx b/chart2/source/view/inc/Stripe.hxx new file mode 100644 index 000000000000..a7e8c4533179 --- /dev/null +++ b/chart2/source/view/inc/Stripe.hxx @@ -0,0 +1,123 @@ +/************************************************************************* + * + * $RCSfile: Stripe.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART_STRIPE_HXX +#define _CHART_STRIPE_HXX + +#ifndef _COM_SUN_STAR_DRAWING_POSITION3D_HPP_ +#include <com/sun/star/drawing/Position3D.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_DIRECTION3D_HPP_ +#include <com/sun/star/drawing/Direction3D.hpp> +#endif + +#ifndef _COM_SUN_STAR_UNO_ANY_H_ +#include <com/sun/star/uno/Any.h> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** A Stripe represents a 2 dimensional foursquare plane in a 3 dimaensional room. + +@todo could: it is not necessary to have 4 point members here; it would be sufficient to have one point and 2 directions +*/ + +class Stripe +{ +public: + Stripe( const ::com::sun::star::drawing::Position3D& rPoint1 + , const ::com::sun::star::drawing::Direction3D& rDirectionToPoint2 + , const ::com::sun::star::drawing::Direction3D& rDirectionToPoint4 ); + +/* + Stripe( const ::com::sun::star::drawing::Position3D& rPoint1 + , const ::com::sun::star::drawing::Position3D& rPoint2 + , const ::com::sun::star::drawing::Position3D& rPoint3 + , const ::com::sun::star::drawing::Position3D& rPoint4 );*/ + + + ::com::sun::star::uno::Any getPolyPolygonShape3D() const; + ::com::sun::star::uno::Any getNormalsPolyPolygonShape3D() const; + + ::com::sun::star::drawing::Position3D GetPosition1() const { return m_aPoint1;}; + ::com::sun::star::drawing::Position3D GetPosition2() const { return m_aPoint2;}; + ::com::sun::star::drawing::Position3D GetPosition3() const { return m_aPoint3;}; + ::com::sun::star::drawing::Position3D GetPosition4() const { return m_aPoint4;}; + + ::com::sun::star::drawing::Direction3D GetDirectionTo4() const; + +private: + ::com::sun::star::drawing::Position3D m_aPoint1; + ::com::sun::star::drawing::Position3D m_aPoint2; + ::com::sun::star::drawing::Position3D m_aPoint3; + ::com::sun::star::drawing::Position3D m_aPoint4; + + ::com::sun::star::drawing::Direction3D + getNormal() const; +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/view/inc/VCoordinateSystem.hxx b/chart2/source/view/inc/VCoordinateSystem.hxx new file mode 100644 index 000000000000..4a071cf48210 --- /dev/null +++ b/chart2/source/view/inc/VCoordinateSystem.hxx @@ -0,0 +1,163 @@ +/************************************************************************* + * + * $RCSfile: VCoordinateSystem.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_VCOORDINATESYSTEM_HXX +#define _CHART2_VCOORDINATESYSTEM_HXX + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_EXPLICITINCREMENTDATA_HPP_ +#include <drafts/com/sun/star/chart2/ExplicitIncrementData.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_EXPLICITSCALEDATA_HPP_ +#include <drafts/com/sun/star/chart2/ExplicitScaleData.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XAXIS_HPP_ +#include <drafts/com/sun/star/chart2/XAxis.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XGRID_HPP_ +#include <drafts/com/sun/star/chart2/XGrid.hpp> +#endif + +#ifndef _COM_SUN_STAR_DRAWING_HOMOGENMATRIX_HPP_ +#include <com/sun/star/drawing/HomogenMatrix.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_XSHAPES_HPP_ +#include <com/sun/star/drawing/XShapes.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#endif +// #ifndef _DRAFTS_COM_SUN_STAR_CHART2_XBOUNDEDCOORDINATESYSTEMCONTAINER_HPP_ +// #include <drafts/com/sun/star/chart2/XBoundedCoordinateSystemContainer.hpp> +// #endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ +class MinimumAndMaximumSupplier; + +class VCoordinateSystem +{ +public: + VCoordinateSystem( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem >& xCooSys ); + virtual ~VCoordinateSystem(); + + void addAxis( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XAxis >& xAxis ); + void setOrigin( double* fCoordinateOrigin ); + void addGrid( const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XGrid >& xGrid ); + + void doAutoScale( MinimumAndMaximumSupplier* pMinMaxSupplier ); + + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XAxis > getAxisByDimension( sal_Int32 nDim ) const; + + const ::com::sun::star::uno::Sequence< ::drafts::com::sun::star::chart2::ExplicitScaleData >& getExplicitScales() const {return m_aExplicitScales;} + const ::com::sun::star::uno::Sequence< ::drafts::com::sun::star::chart2::ExplicitIncrementData >& getExplicitIncrements() const {return m_aExplicitIncrements;} + double getOriginByDimension( sal_Int32 nDim ) const { return m_fCoordinateOrigin[nDim]; } + + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > + getModel() const; + + void createGridShapes( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory>& xShapeFactory + , const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , const ::com::sun::star::drawing::HomogenMatrix& rHM_SceneToScreen + ); + +private: //methods + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XGrid > >& + getGridListByDimension( sal_Int32 nDim ); + +private: //member + + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XBoundedCoordinateSystem > m_xCooSysModel; + + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XAxis > m_xAxis0; + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XAxis > m_xAxis1; + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XAxis > m_xAxis2; + + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XGrid > > m_xGridList0; + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XGrid > > m_xGridList1; + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XGrid > > m_xGridList2; + + double m_fCoordinateOrigin[3]; + + ::com::sun::star::uno::Sequence< ::drafts::com::sun::star::chart2::ExplicitScaleData > m_aExplicitScales; + ::com::sun::star::uno::Sequence< ::drafts::com::sun::star::chart2::ExplicitIncrementData > m_aExplicitIncrements; +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx new file mode 100644 index 000000000000..b45b1e959fea --- /dev/null +++ b/chart2/source/view/inc/VDataSeries.hxx @@ -0,0 +1,200 @@ +/************************************************************************* + * + * $RCSfile: VDataSeries.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_VIEW_DATASERIES_HXX +#define _CHART2_VIEW_DATASERIES_HXX + +#include "ShapeAppearance.hxx" +#include "PropertyMapper.hxx" +/* +#ifndef _B3D_HMATRIX_HXX +#include <goodies/hmatrix.hxx> +#endif +*/ +#include <vector> +//for auto_ptr +#include <memory> + +/* +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_EXPLICITSCALEDATA_HPP_ +#include <drafts/com/sun/star/chart2/ExplicitScaleData.hpp> +#endif +*/ +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_DATACAPTIONSTYLE_HPP_ +#include <drafts/com/sun/star/chart2/DataCaptionStyle.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDATASEQUENCE_HPP_ +#include <drafts/com/sun/star/chart2/XDataSequence.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDATASERIES_HPP_ +#include <drafts/com/sun/star/chart2/XDataSeries.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDATASOURCE_HPP_ +#include <drafts/com/sun/star/chart2/XDataSource.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_HOMOGENMATRIX_HPP_ +#include <com/sun/star/drawing/HomogenMatrix.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_POLYPOLYGONSHAPE3D_HPP_ +#include <com/sun/star/drawing/PolyPolygonShape3D.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_XSHAPE_HPP_ +#include <com/sun/star/drawing/XShape.hpp> +#endif + + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +class VDataSeries +{ +public: + VDataSeries(); + VDataSeries( ::com::sun::star::uno::Reference< ::drafts::com::sun::star::chart2::XDataSeries > + , const ShapeAppearance& rDefaultAppearence ); + virtual ~VDataSeries(); + + sal_Int32 getTotalPointCount() const; + double getX( sal_Int32 index ) const; + double getY( sal_Int32 index ) const; + + rtl::OUString getCategoryString( sal_Int32 index ) const; + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > + getPropertiesOfPoint( sal_Int32 index ) const; + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > + getPropertiesOfSeries() const; + + ShapeAppearance getAppearanceOfPoint( sal_Int32 index ) const; + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xShape; + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xLabelsShape; + + //this is only temporarily here for area chart: + ::com::sun::star::drawing::PolyPolygonShape3D m_aPolyPolygonShape3D; + double m_fMinX; + double m_fMaxX; + // + + rtl::OUString getCID() const; + rtl::OUString getPointCID_Stub() const; + rtl::OUString getLabelsCID() const; + rtl::OUString getLabelCID_Stub() const; + + ::drafts::com::sun::star::chart2::DataCaptionStyle* + getDataCaptionStyle( sal_Int32 index ) const; + bool getTextLabelMultiPropertyLists( sal_Int32 index, tNameSequence*& pPropNames, tAnySequence*& pPropValues ) const; + +private: //methods + bool isAttributedDataPoint( sal_Int32 index ) const; + +private: //member + + ShapeAppearance m_aAppearanceOfSeries; + + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSeries > m_xDataSeries; + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSequence > > m_aDataSequences; + + //all points given by the model data (here are not only the visible points meant) + sal_Int32 m_nPointCount; + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSequence > m_xData_XValues; + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSequence > m_xData_YValues; + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDataSequence > m_xData_ZValues; + + ::com::sun::star::uno::Sequence< double > m_YValues_Double; + + ::com::sun::star::uno::Sequence< sal_Int32 > m_aAttributedDataPointIndexList; + + rtl::OUString m_aIdentifier;//model identifier of this series + rtl::OUString m_aCID; + rtl::OUString m_aPointCID_Stub; + rtl::OUString m_aLabelCID_Stub; + + //some cached values for data labels as they are very expensive + mutable ::std::auto_ptr< ::drafts::com::sun::star::chart2::DataCaptionStyle > + m_apCaption_Series; + mutable ::std::auto_ptr< tNameSequence > m_apLabelPropNames_Series; + mutable ::std::auto_ptr< tAnySequence > m_apLabelPropValues_Series; + + mutable ::std::auto_ptr< ::drafts::com::sun::star::chart2::DataCaptionStyle > + m_apCaption_AttributedPoint; + mutable ::std::auto_ptr< tNameSequence > m_apLabelPropNames_AttributedPoint; + mutable ::std::auto_ptr< tAnySequence > m_apLabelPropValues_AttributedPoint; + mutable sal_Int32 m_nCurrentAttributedPoint; + // +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/view/inc/VDiagram.hxx b/chart2/source/view/inc/VDiagram.hxx new file mode 100644 index 000000000000..4b272adce804 --- /dev/null +++ b/chart2/source/view/inc/VDiagram.hxx @@ -0,0 +1,152 @@ +/************************************************************************* + * + * $RCSfile: VDiagram.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_VDIAGRAM_HXX +#define _CHART2_VDIAGRAM_HXX + +#ifndef _COM_SUN_STAR_DRAWING_HOMOGENMATRIX_HPP_ +#include <com/sun/star/drawing/HomogenMatrix.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_XSHAPES_HPP_ +#include <com/sun/star/drawing/XShapes.hpp> +#endif + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDIAGRAM_HPP_ +#include <drafts/com/sun/star/chart2/XDiagram.hpp> +#endif + +#ifndef _CHART2_VIEW_SHAPEFACTORY_HXX +#include "ShapeFactory.hxx" +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +class ShapeFactory; + +//----------------------------------------------------------------------------- +/** The VDiagram is responsible to generate the visible parts of the Diagram +that is wall, floor, axes and data series. +The axes and data series are subobjects which are created and managed by the +diagram. +*/ + +class VDiagram +{ +public: //methods + VDiagram( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDiagram > & xDiagram, + sal_Int32 nDimension=3, sal_Bool bPolar=sal_False); + virtual ~VDiagram(); + + void SAL_CALL init( const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xLogicTarget + , const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xFinalTarget + , const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory); + + void setSceneMatrix( const ::com::sun::star::drawing::HomogenMatrix& rMatrix ); + + void createShapes( const ::com::sun::star::awt::Point& rPos + , const ::com::sun::star::awt::Size& rSize ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > + getCoordinateRegion(); + + // updateShapes(..); + // const awt::Point& rPos, const awt::Size& rSize ); + +private: //methods + void createShapes_2d( const ::com::sun::star::awt::Point& rPos + , const ::com::sun::star::awt::Size& rSize ); + void createShapes_3d( const ::com::sun::star::awt::Point& rPos + , const ::com::sun::star::awt::Size& rSize ); + +private: //members + VDiagram(const VDiagram& rD); + + ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes > m_xLogicTarget; + ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes > m_xFinalTarget; + ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory> m_xShapeFactory; + ShapeFactory* m_pShapeFactory; + + // this is the surrounding shape which contains floor, wall and coordinate + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xOuterGroupShape; + // this is an additional inner shape that represents the coordinate region - that is - where to place data points + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xCoordinateRegionShape; + + ::com::sun::star::drawing::HomogenMatrix m_oSceneMatrix; + sal_Int32 m_nDimension; + sal_Bool m_bPolar; + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XDiagram > m_xDiagram; +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif + + diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx new file mode 100644 index 000000000000..fbd2bd9c7274 --- /dev/null +++ b/chart2/source/view/inc/VSeriesPlotter.hxx @@ -0,0 +1,208 @@ +/************************************************************************* + * + * $RCSfile: VSeriesPlotter.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_VSERIESPLOTTER_HXX +#define _CHART2_VSERIESPLOTTER_HXX + +#include "PlotterBase.hxx" +#include "VDataSeries.hxx" +#include "PropertyMapper.hxx" + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +class MinimumAndMaximumSupplier +{ +public: + virtual double getMinimumX() { return -0.5; }; + virtual double getMaximumX() { return 10.0; }; + + //problem y maybe not is always the second border to ask for + virtual double getMinimumYInRange( double fMinimumX, double fMaximumX ) { return -2.0; }; + virtual double getMaximumYInRange( double fMinimumX, double fMaximumX ) { return 20.0; }; +}; + +//enum StackType { STACK_NORMAL, STACK_NONE, STACK_BESIDES, STACK_ONTOP, STACK_BEHIND }; + +class VDataSeriesGroup +{ + //a list of series that have the same BoundedCoordinateSystem + //they are used to be plotted maybe in a stacked manner by a plotter + +public: + VDataSeriesGroup(); + VDataSeriesGroup( VDataSeries* pSeries ); + VDataSeriesGroup( const ::std::vector< VDataSeries* >& rSeriesVector ); + virtual ~VDataSeriesGroup(); + + void addSeries( VDataSeries* pSeries );//takes ownership of pSeries + sal_Int32 getSeriesCount() const; + void deleteSeries(); + + void calculateYSumsForCategory( sal_Int32 nCategoryIndex, double& rfPositiveSum, double& rfNegativeSum ); + bool calculateYMinAndMaxForCategoryRange( sal_Int32 nStartCategoryIndex, sal_Int32 nEndCategoryIndex + , double& rfMinimum, double& rfMaximum ); + + void setSums( double fPositiveSum, double fNegativeSum ); + bool getSums( double& rfPositiveSum, double& rfNegativeSum ) const; + + ::std::vector< VDataSeries* > m_aSeriesVector; + +private: + bool m_bSumValuesDirty; + double m_fPositiveSum; + double m_fNegativeSum; + + bool m_bMaxPointCountDirty; + sal_Int32 m_nMaxPointCount; +}; + +class VSeriesPlotter : public PlotterBase, public MinimumAndMaximumSupplier +{ + //------------------------------------------------------------------------- + // public methods + //------------------------------------------------------------------------- +public: + VSeriesPlotter( sal_Int32 nDimension ); + virtual ~VSeriesPlotter(); + + /* + * A new series can be positioned relative to other series in a chart. + * This positioning has two dimensions. First a series can be placed + * next to each other on the category axis. This position is indicated by xSlot. + * Second a series can be stacked on top of another. This position is indicated by ySlot. + * The positions are counted from 0 on. + * xSlot < 0 : append the series to already existing x series + * xSlot > occupied : append the series to already existing x series + * + * If the xSlot is already occupied the given ySlot decides what should happen: + * ySlot < -1 : move all existing series in the xSlot to next slot + * ySlot == -1 : stack on top at given x position + * ySlot == already occupied : insert at given y and x position + * ySlot > occupied : stack on top at given x position + */ + virtual void addSeries( VDataSeries* pSeries, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 ); + + //------------------------------------------------------------------------- + // MinimumAndMaximumSupplier + //------------------------------------------------------------------------- + + virtual double getMinimumX(); + virtual double getMaximumX(); + + virtual double getMinimumYInRange( double fMinimumX, double fMaximumX ); + virtual double getMaximumYInRange( double fMinimumX, double fMaximumX ); + + //------------------------------------------------------------------------- + //------------------------------------------------------------------------- + + static sal_Int32 getPointCount( const VDataSeriesGroup& rSeriesGroup ); + static sal_Int32 getPointCount( const ::std::vector< VDataSeriesGroup >& rSlots ); + + static VSeriesPlotter* createSeriesPlotter( const rtl::OUString& rChartType, sal_Int32 nDimension ); + + //------------------------------------------------------------------------- + //------------------------------------------------------------------------- + //------------------------------------------------------------------------- +private: //methods + //no default constructor + VSeriesPlotter(); + +protected: //methods + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > + getSeriesGroupShape( VDataSeries* pDataSeries + , const::com::sun::star:: uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget ); + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > + getLabelsGroupShape( VDataSeries* pDataSeries + , const::com::sun::star:: uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget ); + + void createDataLabel( const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTarget + , const VDataSeries& rDataSeries + , sal_Int32 nPointIndex + , double fValue + , double fSumValue + , const ::com::sun::star::awt::Point& rScreenPosition2D ); + + virtual void setMappedProperties( + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShape >& xTarget + , const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet >& xSource + , const tPropertyNameMap& rMap ); + +protected: //member + ::std::vector< VDataSeriesGroup > m_aXSlots; + static tMakePropertyNameMap m_aShapePropertyMapForArea; +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif diff --git a/chart2/source/view/inc/ViewDefines.hxx b/chart2/source/view/inc/ViewDefines.hxx new file mode 100644 index 000000000000..b9e7d2326c3f --- /dev/null +++ b/chart2/source/view/inc/ViewDefines.hxx @@ -0,0 +1,82 @@ +/************************************************************************* + * + * $RCSfile: ViewDefines.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:33 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART_COMMONDEFINES_HXX +#define _CHART_COMMONDEFINES_HXX + +namespace chart +{ + +//========================================================================= +// +//========================================================================= +#define CHART_3DOBJECT_SEGMENTCOUNT ((sal_Int32)32) +#define FIXED_SIZE_FOR_3D_CHART_VOLUME (10000.0) +//There needs to be a little distance betweengrid lines and walls in 3D, otherwise the lines are partly hidden by the walls +#define GRID_TO_WALL_DISTANCE (20.0) +#define FLOOR_THICKNESS (100.0) + +const double ZDIRECTION = 1.0; +const sal_Int32 AXIS2D_TICKLENGTH = 150;//value like in old chart +const sal_Int32 AXIS2D_TICKLABELSPACING = 100;//value like in old chart + + +}//end namespace chart +#endif diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx new file mode 100644 index 000000000000..1a13f806dc38 --- /dev/null +++ b/chart2/source/view/main/ChartView.cxx @@ -0,0 +1,627 @@ +/************************************************************************* + * + * $RCSfile: ChartView.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ChartViewImpl.hxx" +#include "PlottingPositionHelper.hxx" +#include "ViewDefines.hxx" +#include "VDiagram.hxx" +#include "VTitle.hxx" +#include "ShapeFactory.hxx" +#include "VAxis.hxx" +#include "VSeriesPlotter.hxx" +#include "CommonConverters.hxx" +#include "macros.hxx" +#include "TitleHelper.hxx" + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_AXISORIENTATION_HPP_ +#include <drafts/com/sun/star/chart2/AxisOrientation.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_EXPLICITSUBINCREMENT_HPP_ +#include <drafts/com/sun/star/chart2/ExplicitSubIncrement.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XAXISCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XAxisContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTDOCUMENT_HPP_ +#include <drafts/com/sun/star/chart2/XChartDocument.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XCHARTTYPEGROUP_HPP_ +#include <drafts/com/sun/star/chart2/XChartTypeGroup.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDATASERIES_HPP_ +#include <drafts/com/sun/star/chart2/XDataSeries.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XDIAGRAM_HPP_ +#include <drafts/com/sun/star/chart2/XDiagram.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XGRIDCONTAINER_HPP_ +#include <drafts/com/sun/star/chart2/XGridContainer.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XSTACKABLESCALEGROUP_HPP_ +#include <drafts/com/sun/star/chart2/XStackableScaleGroup.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTITLED_HPP_ +#include <drafts/com/sun/star/chart2/XTitled.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +//static +ChartView* ChartView::createView( + const uno::Reference< uno::XComponentContext >& xCC + , const uno::Reference< frame::XModel >& xChartModel + , const uno::Reference<drawing::XDrawPagesSupplier>& xDrawPagesSuplier + , NumberFormatterWrapper* pNumberFormatterWrapper ) +{ + return new ChartViewImpl(xCC,xChartModel,xDrawPagesSuplier,pNumberFormatterWrapper); +} + +ChartViewImpl::ChartViewImpl( + const uno::Reference< uno::XComponentContext >& xCC + , const uno::Reference< frame::XModel >& xChartModel + , const uno::Reference<drawing::XDrawPagesSupplier>& xDrawPagesSuplier + , NumberFormatterWrapper* pNumberFormatterWrapper ) + : m_xCC(xCC) + , m_xChartModel(xChartModel) + , m_xShapeFactory(NULL) + , m_xDrawPage(NULL) + , m_pNumberFormatterWrapper( pNumberFormatterWrapper ) + , m_pVDiagram(NULL) + , m_pVLegend(NULL) + , m_pVTitle(NULL) + , m_pVSubtitle(NULL) +{ + //get factory from draw model + m_xShapeFactory = uno::Reference<lang::XMultiServiceFactory>( xDrawPagesSuplier, uno::UNO_QUERY ); + + //create draw page: + uno::Reference<drawing::XDrawPages> xDrawPages = xDrawPagesSuplier->getDrawPages (); + m_xDrawPage = xDrawPages->insertNewByIndex ( 0 ); +} + +ChartViewImpl::~ChartViewImpl() +{ + m_xDrawPage = NULL; +} + +Matrix4D createTransformationSceneToScreen( + const awt::Point& rPos, const awt::Size& rSize ) +{ + Matrix4D aM4; + aM4.Scale(double(rSize.Width)/FIXED_SIZE_FOR_3D_CHART_VOLUME + , -double(rSize.Height)/FIXED_SIZE_FOR_3D_CHART_VOLUME, 1.0 ); + aM4.Translate(double(rPos.X), double(rPos.Y+rSize.Height-1), 0); + return aM4; +} + +drawing::HomogenMatrix createTransformationMatrix() +{ + Matrix4D aM4; + aM4.RotateY( -ZDIRECTION*F_PI/9.0 ); + aM4.RotateX( ZDIRECTION*F_PI/10.0 ); + + //aM4.RotateY( ZDIRECTION*F_PI/2.0 ); + //aM4.RotateX( -ZDIRECTION*F_PI/2.0 ); + + //aM4.RotateX( -ZDIRECTION*F_PI/2.0 ); + + aM4.Translate(0, -FIXED_SIZE_FOR_3D_CHART_VOLUME/2.0, 0); +// aM4.Scale(1, 1, ZDIRECTION); //invert direction of z coordinate to get a left handed system + aM4.Scale(1.0, 1.0, ZDIRECTION); + drawing::HomogenMatrix aHM = Matrix4DToHomogenMatrix(aM4); + return aHM; +} + +ShapeAppearance getDefaultStyle( sal_Int32 nStyle ) +{ + switch(nStyle%8) + { + case 1: + return ShapeAppearance( 0, 0, GEOMETRY_CYLINDER, SYMBOL_DIAMOND ); + case 2: + return ShapeAppearance( 0, 0, GEOMETRY_PYRAMID, SYMBOL_ARROW_DOWN ); + case 3: + return ShapeAppearance( 0, 0, GEOMETRY_CONE, SYMBOL_ARROW_UP ); + case 4: + return ShapeAppearance( 0, 0, GEOMETRY_CUBOID, SYMBOL_ARROW_RIGHT ); + case 5: + return ShapeAppearance( 0, 0, GEOMETRY_CYLINDER, SYMBOL_ARROW_LEFT ); + case 6: + return ShapeAppearance( 0, 0, GEOMETRY_PYRAMID, SYMBOL_BOWTIE ); + case 7: + return ShapeAppearance( 0, 0, GEOMETRY_CONE, SYMBOL_SANDGLASS ); + default: + return ShapeAppearance( 0, 0, GEOMETRY_CUBOID, SYMBOL_SQUARE ); + } +} + +uno::Reference< drawing::XShapes > createDiagram( + const uno::Reference< drawing::XShapes>& xPageShapes + , const uno::Reference< lang::XMultiServiceFactory>& xShapeFactory + , const awt::Point& rPos, const awt::Size& rSize + , sal_Int32 nDimension + , const uno::Reference< XDiagram > & xDia + ) +{ + VDiagram aVDiagram(xDia, nDimension); + aVDiagram.init(xPageShapes,xPageShapes,xShapeFactory); + if(3==nDimension) + aVDiagram.setSceneMatrix( createTransformationMatrix() ); + aVDiagram.createShapes(rPos,rSize); + uno::Reference< drawing::XShapes > xTarget = aVDiagram.getCoordinateRegion(); + return xTarget; +} + +void getCoordinateOrigin( double* fCoordinateOrigin, const uno::Reference< XBoundedCoordinateSystem >& xCoordSys ) +{ + if(xCoordSys.is()) + try + { + uno::Sequence< uno::Any > aCoord( xCoordSys->getOrigin()); + if( aCoord.getLength() >= 1 ) + aCoord[0]>>=fCoordinateOrigin[0]; + if( aCoord.getLength() >= 2 ) + aCoord[1]>>=fCoordinateOrigin[1]; + if( aCoord.getLength() >= 3 ) + aCoord[2]>>=fCoordinateOrigin[2]; + } + catch( uno::Exception& ex) + { + ex; + } +} + +sal_Int32 getDimension( const uno::Reference< XDiagram >& xDiagram ) +{ + sal_Int32 nDimension = 2; + + //@todo maybe get the dimension better from diagram properties ... -> need model change + uno::Reference< XDataSeriesTreeParent > xTree = xDiagram->getTree(); + if(!xTree.is()) + return nDimension; + uno::Sequence< uno::Reference< XDataSeriesTreeNode > > aChartTypes( xTree->getChildren() ); + for( sal_Int32 i = 0; i < aChartTypes.getLength(); ++i ) + { + uno::Reference< XChartTypeGroup > xChartTypeGroup( aChartTypes[i], uno::UNO_QUERY ); + DBG_ASSERT(xChartTypeGroup.is(),"First node at the diagram tree needs to be a ChartTypeGroup"); + if( !xChartTypeGroup.is() ) + continue; + uno::Reference< XChartType > xChartType = xChartTypeGroup->getChartType(); + if( !xChartType.is() ) + continue; + uno::Reference< beans::XPropertySet > xChartTypeProp( xChartType, uno::UNO_QUERY ); + if( xChartTypeProp.is()) + { + try + { + if( !(xChartTypeProp->getPropertyValue( C2U( "Dimension" )) >>= nDimension) ) + { + DBG_ERROR( "Couldn't get Dimension from ChartTypeGroup" ); + } + } + catch( beans::UnknownPropertyException ex ) + { + ex; + } + break; + } + } + return nDimension; +} + +// void getCoordinateSystems( std::vector< VCoordinateSystem >& rVCooSysList, const uno::Reference< XDiagram >& xDiagram ) +// { +// uno::Reference< XBoundedCoordinateSystemContainer > xCooSysContainer = +// uno::Reference< XBoundedCoordinateSystemContainer >::query( xDiagram ); +// if(xCooSysContainer.is()) +// { +// uno::Sequence< uno::Reference< XBoundedCoordinateSystem > > aXCooSysList = xCooSysContainer->getCoordinateSystems(); +// for( sal_Int32 nC=0; nC < aXCooSysList.getLength(); nC++) +// { +// VCoordinateSystem aCooSys(aXCooSysList[nC]); + +// double fCoordinateOrigin[3] = { 0.0, 0.0, 0.0 }; +// getCoordinateOrigin( fCoordinateOrigin, aXCooSysList ); +// aCooSys.setOrigin(fCoordinateOrigin); + +// rVCooSysList.push_back( aCooSys ); +// } +// if(!aXCooSysList.getLength()) +// { +// //get coosys from diagram tree +// //... +// } +// } +// } + +const VCoordinateSystem* findInCooSysList( const std::vector< VCoordinateSystem >& rVCooSysList + , const uno::Reference< XBoundedCoordinateSystem >& xCooSys ) +{ + for( sal_Int32 nC=0; nC < rVCooSysList.size(); nC++) + { + const VCoordinateSystem& rVCooSys = rVCooSysList[nC]; + if(rVCooSys.getModel()==xCooSys) + return &rVCooSys; + } + return NULL; +} + +void addCooSysToList( std::vector< VCoordinateSystem >& rVCooSysList + , const uno::Reference< XBoundedCoordinateSystem >& xCooSys + , double fCoordinateOrigin [] ) +{ + if( !findInCooSysList( rVCooSysList, xCooSys ) ) + { + VCoordinateSystem aVCooSys(xCooSys); + aVCooSys.setOrigin(fCoordinateOrigin); + + rVCooSysList.push_back( aVCooSys ); + } +} + +void getAxesAndAddToCooSys( uno::Sequence< uno::Reference< XAxis > >& rAxisList + , const uno::Reference< XDiagram >& xDiagram + , std::vector< VCoordinateSystem >& rVCooSysList ) +{ + uno::Reference< XAxisContainer > xAxisContainer( xDiagram, uno::UNO_QUERY ); + if( xAxisContainer.is()) + { + rAxisList = xAxisContainer->getAxes(); + for( sal_Int32 nA = 0; nA < rAxisList.getLength(); nA++ ) + { + uno::Reference< XAxis > xAxis( rAxisList[nA] ); + for( sal_Int32 nC=0; nC < rVCooSysList.size(); nC++) + { + if(xAxis->getCoordinateSystem() == rVCooSysList[nC].getModel() ) + { + rVCooSysList[nC].addAxis( xAxis ); + } + } + } + } +} + +void addGridsToCooSys( const uno::Reference< XDiagram >& xDiagram + , std::vector< VCoordinateSystem >& rVCooSysList ) +{ + uno::Reference< XGridContainer > xGridContainer( xDiagram, uno::UNO_QUERY ); + if( xGridContainer.is()) + { + uno::Sequence< uno::Reference< XGrid > > aGridList( + xGridContainer->getGrids() ); + for( sal_Int32 nA = 0; nA < aGridList.getLength(); nA++ ) + { + uno::Reference< XGrid > xGrid( aGridList[nA] ); + for( sal_Int32 nC=0; nC < rVCooSysList.size(); nC++) + { + if(xGrid->getCoordinateSystem() == rVCooSysList[nC].getModel() ) + { + rVCooSysList[nC].addGrid( xGrid ); + } + } + } + } +} + +void initializeDiagramAndGetCooSys( std::vector< VCoordinateSystem >& rVCooSysList + , const uno::Reference< uno::XComponentContext>& xCC + , const uno::Reference< drawing::XShapes>& xPageShapes + , const uno::Reference< lang::XMultiServiceFactory>& xShapeFactory + , NumberFormatterWrapper* pNumberFormatterWrapper + , const awt::Point& rPos, const awt::Size& rSize + , const uno::Reference< frame::XModel >& xModel ) +{ + //------------ get model series from model + uno::Reference< XChartDocument > xChartDocument( xModel, uno::UNO_QUERY ); + if( !xChartDocument.is() ) + return; + uno::Reference< XDiagram > xDiagram = xChartDocument->getDiagram(); + if( !xDiagram.is()) + return; + + sal_Int32 nDimension = getDimension( xDiagram ); + + //------------ create Diagram shapes + uno::Reference< drawing::XShapes > xTarget = createDiagram( xPageShapes, xShapeFactory, rPos, rSize, nDimension, xDiagram ); + + //------------ get all coordinatesystems +// getCoordinateSystems( rVCooSysList, xDiagram ); + + //------------ add series to plotter and thus prepare him for providing minimum and maximum values + uno::Reference< XDataSeriesTreeParent > xTree = xDiagram->getTree(); + uno::Sequence< uno::Reference< XDataSeriesTreeNode > > aChartTypes( xTree->getChildren() ); + for( sal_Int32 i = 0; i < aChartTypes.getLength(); ++i ) + { + //iterate through different charttypes: + + uno::Reference< XChartTypeGroup > xChartTypeGroup( aChartTypes[i], uno::UNO_QUERY ); + DBG_ASSERT(xChartTypeGroup.is(),"First node at the diagram tree needs to be a ChartTypeGroup"); + if( !xChartTypeGroup.is() ) + continue; + ::std::auto_ptr< VSeriesPlotter > apPlotter( VSeriesPlotter::createSeriesPlotter( xChartTypeGroup->getChartType()->getChartType(), nDimension ) ); + + //------------ add series to plotter and thus prepare him for providing minimum and maximum values + + sal_Int32 nXSlot = -1; + sal_Int32 nYSlot = -1; + uno::Sequence< uno::Reference< XDataSeriesTreeNode > > aXSlots( xChartTypeGroup->getChildren() ); + for( sal_Int32 nX = 0; nX < aXSlots.getLength(); ++nX ) + { + uno::Reference< XDataSeriesTreeParent > xXSlot = uno::Reference< XDataSeriesTreeParent >::query( aXSlots[nX] ); + DBG_ASSERT( xXSlot.is(), "a node for the first dimension of a chart tree should always be a parent" ); + if(!xXSlot.is()) + return; + uno::Reference< XStackableScaleGroup > xStackGroup = uno::Reference< XStackableScaleGroup >::query( xXSlot ); + if( xStackGroup.is() && + xStackGroup->getStackMode()==StackMode_STACKED) + nXSlot++; + uno::Sequence< uno::Reference< XDataSeriesTreeNode > > aYSlots( + xXSlot->getChildren() ); + for( sal_Int32 nY = 0; nY < aYSlots.getLength(); ++nY ) + { + uno::Reference< XDataSeriesTreeParent > xYSlot = uno::Reference< XDataSeriesTreeParent >::query( aYSlots[nY] ); + DBG_ASSERT( xYSlot.is(), "a node for the second dimension of a chart tree should always be a parent" ); + if(!xYSlot.is()) + return; + + uno::Reference< XScaleGroup > xScaleGroup( xYSlot, uno::UNO_QUERY ); + + { + double fCoordinateOrigin[3] = { 0.0, 0.0, 0.0 }; + getCoordinateOrigin( fCoordinateOrigin, xScaleGroup->getCoordinateSystem() ); + addCooSysToList(rVCooSysList,xScaleGroup->getCoordinateSystem(),fCoordinateOrigin); + } + + uno::Reference< XStackableScaleGroup > xStackGroup = uno::Reference< XStackableScaleGroup >::query( xYSlot ); + StackMode aYStackMode = StackMode_NONE; + if(xStackGroup.is()) + aYStackMode = xStackGroup->getStackMode(); + if(aYStackMode==StackMode_STACKED) + nYSlot++; + uno::Sequence< uno::Reference< XDataSeriesTreeNode > > aSeriesList( xYSlot->getChildren() ); + for( sal_Int32 nS = 0; nS < aSeriesList.getLength(); ++nS ) + { + uno::Reference< XDataSeries > xDataSeries( aSeriesList[nS], uno::UNO_QUERY ); + + VDataSeries* pTestSeries = new VDataSeries( xDataSeries, getDefaultStyle(nS) ); + //virtual void addSeries( VDataSeries* pSeries, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 ); + sal_Int32 nXSlot = 0; + if(aYStackMode==StackMode_NONE) + nXSlot=-1; + //@todo + apPlotter->addSeries( pTestSeries, nXSlot ); + // apPlotter->addSeries( pTestSeries, nXSlot, nYSlot ); + /* + if(nN==nSeriesCount-1) + apPlotter->addSeries( pTestSeries, -1 ); + else + apPlotter->addSeries( pTestSeries, 0 ); + */ + } + } + } + + //------------ get all axes from model and add to VCoordinateSystems + uno::Sequence< uno::Reference< XAxis > > aAxisList; + getAxesAndAddToCooSys( aAxisList, xDiagram, rVCooSysList ); + + addGridsToCooSys( xDiagram, rVCooSysList ); + + + //------------ iterate through all coordinate systems + for( sal_Int32 nC=0; nC < rVCooSysList.size(); nC++) + { + //------------ create explicit scales and increments + VCoordinateSystem& rVCooSys = rVCooSysList[nC]; + rVCooSys.doAutoScale( apPlotter.get() ); + + const uno::Sequence< ExplicitScaleData >& rExplicitScales = rVCooSys.getExplicitScales(); + const uno::Sequence< ExplicitIncrementData >& rExplicitIncrements = rVCooSys.getExplicitIncrements(); + + double fCoordinateOrigin[3] = { 0.0, 0.0, 0.0 }; + for( sal_Int32 nDim = 0; nDim < 3; nDim++ ) + fCoordinateOrigin[nDim] = rVCooSys.getOriginByDimension( nDim ); + + Matrix4D aM4_SceneToScreen( createTransformationSceneToScreen(rPos,rSize) ); + drawing::HomogenMatrix aHM_SceneToScreen( Matrix4DToHomogenMatrix(aM4_SceneToScreen) ); + + //------------ create axes --- @todo do auto layout / fontscaling + for( nDim = 0; nDim < 3; nDim++ ) + { + uno::Reference< XAxis > xAxis = rVCooSys.getAxisByDimension(nDim); + if(xAxis.is() + &&2==nDimension) //@todo remove this restriction if 3D axes are available + { + AxisProperties aAxisProperties; + aAxisProperties.m_xAxisModel = xAxis; + aAxisProperties.m_pfExrtaLinePositionAtOtherAxis = + new double(nDim==1?fCoordinateOrigin[0]:fCoordinateOrigin[1]); + aAxisProperties.m_bTESTTEST_HorizontalAdjustmentIsLeft = sal_False; + //------------------- + VAxis aAxis(aAxisProperties,pNumberFormatterWrapper); + aAxis.setMeterData( rExplicitScales[nDim], rExplicitIncrements[nDim] ); + + aAxis.init(xTarget,xPageShapes,xShapeFactory); + if(2==nDimension) + aAxis.setTransformationSceneToScreen( aHM_SceneToScreen ); + aAxis.setScales( rExplicitScales ); + aAxis.createShapes(); + } + } + //------------ create grids + rVCooSys.createGridShapes( xShapeFactory, xTarget, aHM_SceneToScreen ); + + //------------ set scale to plotter + apPlotter->init(xTarget,xPageShapes,xShapeFactory); + if(2==nDimension) + apPlotter->setTransformationSceneToScreen( aHM_SceneToScreen ); + apPlotter->setScales( rExplicitScales ); + apPlotter->createShapes(); + } + } +} + +//------------------------------------------------------------- +//------------------------------------------------------------- +//------------------------------------------------------------- + +void ChartViewImpl::getExplicitValuesForMeter( + uno::Reference< XMeter > xMeter + , ExplicitScaleData& rExplicitScale + , ExplicitIncrementData& rExplicitIncrement + , double& rfExplicitOrigin ) +{ + if(!xMeter.is()) + return; + uno::Reference< XBoundedCoordinateSystem > xCooSys = xMeter->getCoordinateSystem(); + const VCoordinateSystem* pVCooSys = findInCooSysList(m_aVCooSysList,xCooSys); + if(!pVCooSys) + return; + const uno::Sequence< ExplicitScaleData >& rScales =pVCooSys->getExplicitScales(); + const uno::Sequence< ExplicitIncrementData >& rIncrements =pVCooSys->getExplicitIncrements(); + sal_Int32 nDim = xMeter->getRepresentedDimension(); + if(nDim<=rScales.getLength()) + rExplicitScale=rScales[nDim]; + if(nDim<=rIncrements.getLength()) + rExplicitIncrement=rIncrements[nDim]; + rfExplicitOrigin = pVCooSys->getOriginByDimension( nDim ); +} + +bool getPosAndSizeForDiagram( awt::Point& rPos, awt::Size& rSize, const awt::Size& rPageSize, sal_Int32 nYOffset ) +{ + if(rPageSize.Width <= 0 || rPageSize.Height <= 0 ) + return false; + + long nHeight = (rPageSize.Height-nYOffset)*5/6; + long nOffsetY = (rPageSize.Height-nYOffset)-nHeight; + nOffsetY /= 2; + nOffsetY += nYOffset; + + long nWidth = rPageSize.Width*5/6; + long nOffsetX = rPageSize.Width-nWidth; + nOffsetX /= 2; + + if( nHeight <= 0 || nWidth <= 0 ) + return false; + + rPos = awt::Point(nOffsetX,nOffsetY); + rSize = awt::Size(nWidth,nHeight); + return true; +} + +void createTitle( const uno::Reference< XTitle >& xTitle + , sal_Int32 nXPosition + , sal_Int32& nrYOffset + , const uno::Reference< drawing::XShapes>& xPageShapes + , const uno::Reference< lang::XMultiServiceFactory>& xShapeFactory + ) +{ + if(xTitle.is()) + { + VTitle aVTitle(xTitle); + aVTitle.init(xPageShapes,xShapeFactory); + aVTitle.createShapes( awt::Point(0,0) ); + awt::Size aTitleSize = aVTitle.getSize(); + sal_Int32 nYSpacing = aTitleSize.Height/2; + aVTitle.changePosition( awt::Point( nXPosition, nrYOffset + aTitleSize.Height/2 + nYSpacing ) ); + nrYOffset += aTitleSize.Height + nYSpacing; + } +} + +bool ChartViewImpl::create( const awt::Size& rPageSize ) +{ + uno::Reference<drawing::XShapes> xPageShapes = + uno::Reference<drawing::XShapes>( m_xDrawPage, uno::UNO_QUERY ); + + sal_Int32 nYOffset = 0; + sal_Int32 nXPosition = rPageSize.Width/2; + + //------------ create main title shape + createTitle( TitleHelper::getTitle( TitleHelper::MAIN_TITLE, m_xChartModel ) + , nXPosition, nYOffset, xPageShapes, m_xShapeFactory ); + if(nYOffset>=rPageSize.Height) + return true; + + //------------ create sub title shape + createTitle( TitleHelper::getTitle( TitleHelper::SUB_TITLE, m_xChartModel ) + , nXPosition, nYOffset, xPageShapes, m_xShapeFactory ); + if(nYOffset>=rPageSize.Height) + return true; + + //------------ create complete diagram shape (inclusive axis and series) + awt::Point aPosDia; + awt::Size aSizeDia; + if( getPosAndSizeForDiagram( aPosDia, aSizeDia, rPageSize, nYOffset ) ) + initializeDiagramAndGetCooSys( m_aVCooSysList + , m_xCC, xPageShapes, m_xShapeFactory, m_pNumberFormatterWrapper + , aPosDia ,aSizeDia + , m_xChartModel ); + return true; +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/main/Linear3DTransformation.cxx b/chart2/source/view/main/Linear3DTransformation.cxx new file mode 100644 index 000000000000..ff33bf30475e --- /dev/null +++ b/chart2/source/view/main/Linear3DTransformation.cxx @@ -0,0 +1,136 @@ +/************************************************************************* + * + * $RCSfile: Linear3DTransformation.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2002 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Linear3DTransformation.hxx" + +using namespace ::com::sun::star; + +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::RuntimeException; + +namespace chart +{ + + Linear3DTransformation::Linear3DTransformation( const drawing::HomogenMatrix& rHomMatrix ) + : m_Matrix(rHomMatrix) +{} + +Linear3DTransformation::~Linear3DTransformation() +{} + +// ____ XTransformation ____ +Sequence< double > SAL_CALL Linear3DTransformation::transform( + const Sequence< double >& rSourceValues ) + throw (RuntimeException, + lang::IllegalArgumentException) +{ + /* + Vector3D aSource( SequenceToVector3D( rSourceValues ) ); + Vector3D aTarget = m_Matrix*aSource; + return Vector3DToSequence(aTarget); + */ + Sequence< double > aNewVec(3); + double fZwi; + + fZwi = m_Matrix.Line1.Column1 * rSourceValues[0] + + m_Matrix.Line1.Column2 * rSourceValues[1] + + m_Matrix.Line1.Column3 * rSourceValues[2] + + m_Matrix.Line1.Column4; + aNewVec[0] = fZwi; + + fZwi = m_Matrix.Line2.Column1 * rSourceValues[0] + + m_Matrix.Line2.Column2 * rSourceValues[1] + + m_Matrix.Line2.Column3 * rSourceValues[2] + + m_Matrix.Line2.Column4; + aNewVec[1] = fZwi; + + fZwi = m_Matrix.Line3.Column1 * rSourceValues[0] + + m_Matrix.Line3.Column2 * rSourceValues[1] + + m_Matrix.Line3.Column3 * rSourceValues[2] + + m_Matrix.Line3.Column4; + aNewVec[2] = fZwi; + + fZwi = m_Matrix.Line4.Column1 * rSourceValues[0] + + m_Matrix.Line4.Column2 * rSourceValues[1] + + m_Matrix.Line4.Column3 * rSourceValues[2] + + m_Matrix.Line4.Column4; + if(fZwi != 1.0 && fZwi != 0.0) + { + aNewVec[0] /= fZwi; + aNewVec[1] /= fZwi; + aNewVec[2] /= fZwi; + } + return aNewVec; +} + +sal_Int32 SAL_CALL Linear3DTransformation::getSourceDimension() + throw (RuntimeException) +{ + return 3; +} + +sal_Int32 SAL_CALL Linear3DTransformation::getTargetDimension() + throw (RuntimeException) +{ + return 3; +} + + +} // namespace chart diff --git a/chart2/source/view/main/NumberFormatterWrapper.cxx b/chart2/source/view/main/NumberFormatterWrapper.cxx new file mode 100644 index 000000000000..2e4cfc9e1236 --- /dev/null +++ b/chart2/source/view/main/NumberFormatterWrapper.cxx @@ -0,0 +1,208 @@ +/************************************************************************* + * + * $RCSfile: NumberFormatterWrapper.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "chartview/NumberFormatterWrapper.hxx" +#include "macros.hxx" + +#ifndef _COMPHELPER_PROCESSFACTORY_HXX_ +#include <comphelper/processfactory.hxx> +#endif +// header for class SvNumberformat +#ifndef _ZFORMAT_HXX +#include <svtools/zformat.hxx> +#endif +#ifndef _TOOLS_COLOR_HXX +#include <tools/color.hxx> +#endif +#ifndef _ISOLANG_HXX +#include <tools/isolang.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +FixedNumberFormatter::FixedNumberFormatter( + NumberFormatterWrapper* pNumberFormatterWrapper + , const ::drafts::com::sun::star::chart2::NumberFormat& rNumberFormat ) + : m_pNumberFormatterWrapper(pNumberFormatterWrapper) + , m_nFormatIndex(0) +{ + //add the given format string to the NumberFormatter and + //get the index of that format to use further + if( m_pNumberFormatterWrapper ) + m_nFormatIndex = m_pNumberFormatterWrapper->getKeyForNumberFormat( rNumberFormat ); +} + +FixedNumberFormatter::~FixedNumberFormatter() +{ +} + +/* +sal_Int32 FixedNumberFormatter::getTextAndColor( double fUnscaledValueForText, rtl::OUString& rLabel ) const +{ + sal_Int32 nLabelColor = Color(COL_BLUE).GetColor(); //@todo get this from somewheres + rLabel = getFormattedString( fUnscaledValueForText, nLabelColor ); + return nLabelColor; +} +*/ + +rtl::OUString FixedNumberFormatter::getFormattedString( double fValue, sal_Int32& rLabelColor, bool& rbColorChanged ) const +{ + String aText; + Color* pTextColor = NULL; + m_pNumberFormatterWrapper->m_pNumberFormatter->GetOutputString( + fValue, m_nFormatIndex, aText, &pTextColor); + rtl::OUString aRet( aText ); + + if(pTextColor) + { + rbColorChanged = true; + rLabelColor = pTextColor->GetColor(); + } + else + rbColorChanged = false; + + return aRet; +} + +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + +NumberFormatterWrapper::NumberFormatterWrapper() + : m_pNumberFormatter(NULL) + +{ + //@todo: use a formatter via api (does not exsist so far) + m_pNumberFormatter = new SvNumberFormatter( + //m_xCC->getServiceManager() , + ::comphelper::getProcessServiceFactory(), + LANGUAGE_SYSTEM ); +} +NumberFormatterWrapper::~NumberFormatterWrapper() +{ + delete m_pNumberFormatter; +} + +SvNumberFormatter* NumberFormatterWrapper::getSvNumberFormatter() const +{ + return m_pNumberFormatter; +} + +LanguageType lcl_GetLanguage( const lang::Locale& rLocale ) +{ + // empty language -> LANGUAGE_SYSTEM + if ( rLocale.Language.getLength() == 0 ) + return LANGUAGE_SYSTEM; + + String aLangStr = rLocale.Language; + String aCtryStr = rLocale.Country; + // Variant is ignored + + LanguageType eRet = ConvertIsoNamesToLanguage( aLangStr, aCtryStr ); + if ( eRet == LANGUAGE_NONE ) + eRet = LANGUAGE_SYSTEM; //! or throw an exception? + + return eRet; +} + +sal_Int32 NumberFormatterWrapper::getKeyForNumberFormat( const NumberFormat& rNumberFormat ) const +{ + String aStr( rNumberFormat.aFormat ); + LanguageType eLnge = lcl_GetLanguage( rNumberFormat.aLocale ); + return m_pNumberFormatter->GetEntryKey( aStr, eLnge ); +} + +NumberFormat NumberFormatterWrapper::getNumberFormatForKey( sal_Int32 nIndex ) const +{ + const SvNumberformat* pSvNumberformat = m_pNumberFormatter->GetEntry( nIndex ); + + NumberFormat aNumberFormat; + aNumberFormat.aFormat = pSvNumberformat->GetFormatstring(); + LanguageType nLanguageType = pSvNumberformat->GetLanguage(); + aNumberFormat.aLocale = SvNumberFormatter::ConvertLanguageToLocale( nLanguageType ); + return aNumberFormat; +} + +/* + uno::Reference< i18n::XNumberFormatCode > xNumberFormatCode( + m_xCC->getServiceManager()->createInstanceWithContext( C2U( + "com.sun.star.i18n.NumberFormatMapper" ), m_xCC ), uno::UNO_QUERY ); + + i18n::NumberFormatCode aNumberFormatCode = xNumberFormatCode->getDefault ( + i18n::KNumberFormatType::MEDIUM, + i18n::KNumberFormatUsage::SCIENTIFIC_NUMBER, + aLocale ); + + uno::Sequence< i18n::NumberFormatCode > aListOfNumberFormatCode = xNumberFormatCode->getAllFormatCode( + i18n::KNumberFormatUsage::SCIENTIFIC_NUMBER, + aLocale ); + + i18n::NumberFormatCode aNumberFormatCode0 = aListOfNumberFormatCode[0]; + i18n::NumberFormatCode aNumberFormatCode1 = aListOfNumberFormatCode[1]; +*/ + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/main/PlotterBase.cxx b/chart2/source/view/main/PlotterBase.cxx new file mode 100644 index 000000000000..2ddd0455de25 --- /dev/null +++ b/chart2/source/view/main/PlotterBase.cxx @@ -0,0 +1,244 @@ +/************************************************************************* + * + * $RCSfile: PlotterBase.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "PlotterBase.hxx" +#include "PlottingPositionHelper.hxx" +#include "ShapeFactory.hxx" + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_DATACAPTIONSTYLE_HPP_ +#include <drafts/com/sun/star/chart2/DataCaptionStyle.hpp> +#endif + +/* +#ifndef _SV_GEN_HXX +#include <vcl/gen.hxx> +#endif +*/ +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +PlotterBase::PlotterBase( sal_Int32 nDimensionCount ) + : m_xLogicTarget(NULL) + , m_xFinalTarget(NULL) + , m_xShapeFactory(NULL) + , m_pShapeFactory(NULL) + , m_nDimension(nDimensionCount) + , m_pPosHelper(NULL) +{ +} + + void SAL_CALL PlotterBase +::init( const uno::Reference< drawing::XShapes >& xLogicTarget + , const uno::Reference< drawing::XShapes >& xFinalTarget + , const uno::Reference< lang::XMultiServiceFactory >& xShapeFactory ) + throw (uno::RuntimeException) +{ + DBG_ASSERT(xLogicTarget.is()&&xFinalTarget.is()&&xShapeFactory.is(),"no proper initialization parameters"); + //is only allowed to be called once + m_xLogicTarget = xLogicTarget; + m_xFinalTarget = xFinalTarget; + m_xShapeFactory = xShapeFactory; + m_pShapeFactory = new ShapeFactory(xShapeFactory); +} + +PlotterBase::~PlotterBase() +{ + delete m_pShapeFactory; +} + +void SAL_CALL PlotterBase::setScales( const uno::Sequence< ExplicitScaleData >& rScales ) + throw (uno::RuntimeException) +{ + DBG_ASSERT(m_nDimension<=rScales.getLength(),"Dimension of Plotter does not fit two dimension of given scale sequence"); + m_pPosHelper->setScales( rScales ); +} + + +void PlotterBase::setTransformationSceneToScreen( const drawing::HomogenMatrix& rMatrix) +{ + DBG_ASSERT(m_nDimension==2,"Set this transformation only in case of 2D"); + if(m_nDimension!=2) + return; + m_pPosHelper->setTransformationSceneToScreen( rMatrix ); +} + +uno::Reference< drawing::XShapes > PlotterBase::createGroupShape( + const uno::Reference< drawing::XShapes >& xTarget + , const ::rtl::OUString& rName ) +{ + if(!m_xShapeFactory.is()) + return NULL; + + if(m_nDimension==2) + { + //create and add to target + return m_pShapeFactory->createGroup2D( xTarget, rName ); + } + else + { + //create and added to target + return m_pShapeFactory->createGroup3D( xTarget, rName ); + } +} + +/* +//----------------------------------------------------------------- +// chart2::XPlotter +//----------------------------------------------------------------- + + ::rtl::OUString SAL_CALL PlotterBase +::getCoordinateSystemTypeID() + throw (uno::RuntimeException) +{ + return CHART2_COOSYSTEM_CARTESIAN2D_SERVICE_NAME; +} + + void SAL_CALL PlotterBase +::setScales( const uno::Sequence< ExplicitScaleData >& rScales ) throw (uno::RuntimeException) +{ +} + void SAL_CALL PlotterBase +::setTransformation( const uno::Reference< XTransformation >& xTransformationToLogicTarget, const uno::Reference< XTransformation >& xTransformationToFinalPage ) throw (uno::RuntimeException) +{ +} +*/ + +//e.g. for Rectangle +/* +uno::Reference< drawing::XShape > PlotterBase::createPartialPointShape( + CooPoint + series dependent properties ...(create a special struct for each chart type) + , uno::Reference< XThinCoordinateSystem > xCoo + , sal_Bool bIsInBreak + , PointStyle* pStyle ) +{ + //create one here; use scaling and transformation to logic target + + //maybe do not show anything in the break //maybe read the behavior out of the configuration + //if(bIsInBreak) + // return NULL; + + uno::Reference< drawing::XShape > xNewPartialPointShape( + m_xShapeFactory->createInstance( + rtl::OUString::createFromAscii( "com.sun.star.drawing.RectangleShape" ) ) + , uno::UNO_QUERY ); + //set size and position + { + // + } + if(pStyle||bIsInBreak) + { + //set style properties if any for a single point + uno::Reference< beans::XPropertySet > xProp( xNewPartialPointShape, uno::UNO_QUERY ); + xProp->setPropertyValue( ... ); + + //set special properties if point in break (e.g. additional transparency ...) + } +} + +//e.g. for PlotterBase in 2 dim cartesian coordinates: +sal_Bool ShapeFactory::isShown( const Sequence< ExplicitScaleData >& rScales, const CooPoint& rP, double dLogicalWidthBeforeScaling ) +{ + ASSERT(rScales.getLength()==2) + double dMin_x = rScales[0].Minimum; + double dMax_x = rScales[0].Maximum; + double dMin_y = rScales[1].Minimum; + double dMax_y = rScales[1].Maximum; + + //we know that we have cartesian geometry + Rectangle aSysRect( rScales[0].Minimum, rScales[1].Maximum, rScales[0].Maximum, rScales[1].Minimum ); + Rectangle aPointRect( dLogicalWidthBeforeScaling ) + if(rP) +} + +//----------------------------------------------------------------------------- + +class FatCoordinateSystem +{ +public: + //XCoordinateSystemType getType(); + Sequence<XThinCoordinateSystem> getCoordinateSystems(); +} + +class ThinCoordinateSystem +{ +private: + +public: + sal_Bool isBreak(); + Sequence< ExplicitScaleData > getScales();//SubScales without beak + + +} +*/ +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx new file mode 100644 index 000000000000..c05355a37766 --- /dev/null +++ b/chart2/source/view/main/PlottingPositionHelper.cxx @@ -0,0 +1,188 @@ +/************************************************************************* + * + * $RCSfile: PlottingPositionHelper.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "PlottingPositionHelper.hxx" +#include "CommonConverters.hxx" +#include "ViewDefines.hxx" +#include "Linear3DTransformation.hxx" + +#ifndef _COM_SUN_STAR_DRAWING_POSITION3D_HPP_ +#include <com/sun/star/drawing/Position3D.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +PlottingPositionHelper::PlottingPositionHelper() + : m_aScales() + , m_aMatrixScreenToScene() + , m_xTransformationLogicToScene(NULL) + +{ +} + +PlottingPositionHelper::~PlottingPositionHelper() +{ + +} + +void PlottingPositionHelper::setTransformationSceneToScreen( const drawing::HomogenMatrix& rMatrix) +{ + m_aMatrixScreenToScene = HomogenMatrixToMatrix4D(rMatrix); + m_xTransformationLogicToScene = NULL; +} + +void PlottingPositionHelper::setScales( const uno::Sequence< ExplicitScaleData >& rScales ) +{ + m_aScales = rScales; + m_xTransformationLogicToScene = NULL; +} + +uno::Reference< XTransformation > PlottingPositionHelper::getTransformationLogicToScene() const +{ + //this is a standard transformation for a cartesian coordinate system + + //transformation from 2) to 4) //@todo 2) and 4) need a ink to a document + + //we need to apply this transformation to each geometric object because of a bug/problem + //of the old drawing layer (the UNO_NAME_3D_EXTRUDE_DEPTH is an integer value instead of an double ) + if(!m_xTransformationLogicToScene.is()) + { + Matrix4D aMatrix; + double MinX = getLogicMinX(); + double MinY = getLogicMinY(); + double MinZ = getLogicMinZ(); + double MaxX = getLogicMaxX(); + double MaxY = getLogicMaxY(); + double MaxZ = getLogicMaxZ(); + + //apply scaling + doLogicScaling( &MinX, &MinY, &MinZ ); + doLogicScaling( &MaxX, &MaxY, &MaxZ); + + aMatrix.TranslateX(-MinX); + aMatrix.TranslateY(-MinY); + aMatrix.TranslateZ(-MinZ); + + double fWidthX = MaxX - MinX; + double fWidthY = MaxY - MinY; + double fWidthZ = MaxZ - MinZ; + + aMatrix.ScaleX(FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthX); + aMatrix.ScaleY(FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthY); + aMatrix.ScaleZ(FIXED_SIZE_FOR_3D_CHART_VOLUME/fWidthZ); + + aMatrix = aMatrix*m_aMatrixScreenToScene; + + m_xTransformationLogicToScene = new Linear3DTransformation(Matrix4DToHomogenMatrix( aMatrix )); + } + return m_xTransformationLogicToScene; +} + +void PlottingPositionHelper::getScreenValuesForMinimum( uno::Sequence< double >& rSeq ) const +{ + double fX = this->getLogicMinX(); + double fY = this->getLogicMinY(); + double fZ = this->getLogicMinZ(); + + this->doLogicScaling( &fX,&fY,&fZ ); + drawing::Position3D aPos( fX, fY, fZ); + + uno::Reference< XTransformation > xTransformation = + this->getTransformationLogicToScene(); + rSeq = xTransformation->transform( Position3DToSequence(aPos) ); +} + +void PlottingPositionHelper::getScreenValuesForMaximum( uno::Sequence< double >& rSeq ) const +{ + double fX = this->getLogicMaxX(); + double fY = this->getLogicMaxY(); + double fZ = this->getLogicMaxZ(); + + this->doLogicScaling( &fX,&fY,&fZ ); + drawing::Position3D aPos( fX, fY, fZ); + + uno::Reference< XTransformation > xTransformation = + this->getTransformationLogicToScene(); + rSeq = xTransformation->transform( Position3DToSequence(aPos) ); +} + +void PlottingPositionHelper::getLogicMinimum( ::com::sun::star::uno::Sequence< double >& rSeq ) const +{ + rSeq.realloc(3); + rSeq[0] = this->getLogicMinX(); + rSeq[1] = this->getLogicMinY(); + rSeq[2] = this->getLogicMinZ(); +} +void PlottingPositionHelper::getLogicMaximum( ::com::sun::star::uno::Sequence< double >& rSeq ) const +{ + rSeq.realloc(3); + rSeq[0] = this->getLogicMaxX(); + rSeq[1] = this->getLogicMaxY(); + rSeq[2] = this->getLogicMaxZ(); +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx new file mode 100644 index 000000000000..aedf30cd0e0c --- /dev/null +++ b/chart2/source/view/main/PropertyMapper.cxx @@ -0,0 +1,358 @@ +/************************************************************************* + * + * $RCSfile: PropertyMapper.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "PropertyMapper.hxx" +#include "macros.hxx" + +#ifndef _COM_SUN_STAR_BEANS_XMULTIPROPERTYSET_HPP_ +#include <com/sun/star/beans/XMultiPropertySet.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; + +//static +void PropertyMapper::setMappedProperties( + const uno::Reference< beans::XPropertySet >& xTarget + , const uno::Reference< beans::XPropertySet >& xSource + , const tPropertyNameMap& rMap ) +{ + if( !xTarget.is() || !xSource.is() ) + return; + + uno::Reference< beans::XMultiPropertySet > xMultiProp( xTarget, uno::UNO_QUERY ); + if( xMultiProp.is() ) + { + tNameSequence aNames; + tAnySequence aValues; + getMultiPropertyLists(aNames, aValues, xSource, rMap ); + try + { + xMultiProp->setPropertyValues( aNames,aValues ); + } + catch( uno::Exception& e ) + { + e; + } + } + else + { + tPropertyNameMap::const_iterator aIt( rMap.begin() ); + tPropertyNameMap::const_iterator aEnd( rMap.end() ); + for( ; aIt != aEnd; ++aIt ) + { + rtl::OUString aTarget = aIt->first; + rtl::OUString aSource = aIt->second; + try + { + uno::Any aAny( xSource->getPropertyValue(aSource) ); + xTarget->setPropertyValue( aTarget, aAny ); + } + catch( uno::Exception& e ) + { + e; + } + } + } +} + +void PropertyMapper::getValueMap( + tPropertyNameValueMap& rValueMap + , const tPropertyNameMap& rNameMap + , const uno::Reference< beans::XPropertySet >& xSourceProp + ) +{ + tPropertyNameMap::const_iterator aIt( rNameMap.begin() ); + tPropertyNameMap::const_iterator aEnd( rNameMap.end() ); + + for( ; aIt != aEnd; ++aIt ) + { + rtl::OUString aTarget = aIt->first; + rtl::OUString aSource = aIt->second; + try + { + uno::Any aAny( xSourceProp->getPropertyValue(aSource) ); + if( aAny.hasValue() ) + rValueMap.insert( tPropertyNameValueMap::value_type( aTarget, aAny ) ); + } + catch( uno::Exception& e ) + { + e; + } + } +} + +void PropertyMapper::getMultiPropertyLists( + tNameSequence& rNames + , tAnySequence& rValues + , const uno::Reference< beans::XPropertySet >& xSourceProp + , const tPropertyNameMap& rNameMap + ) +{ + tPropertyNameValueMap aValueMap; + getValueMap( aValueMap, rNameMap, xSourceProp ); + getMultiPropertyListsFromValueMap( rNames, rValues, aValueMap ); +} + +void PropertyMapper::getMultiPropertyListsFromValueMap( + tNameSequence& rNames + , tAnySequence& rValues + , const tPropertyNameValueMap& rValueMap + ) +{ + sal_Int32 nPropertyCount = rValueMap.size(); + rNames.realloc(nPropertyCount); + rValues.realloc(nPropertyCount); + + //fill sequences + tPropertyNameValueMap::const_iterator aValueIt( rValueMap.begin() ); + tPropertyNameValueMap::const_iterator aValueEnd( rValueMap.end() ); + sal_Int32 nN=0; + for( ; aValueIt != aValueEnd; ++aValueIt ) + { + const uno::Any& rAny = aValueIt->second; + if( rAny.hasValue() ) + { + //do not set empty anys because of performance (otherwise SdrAttrObj::ItemChange will take much longer) + rNames[nN] = aValueIt->first; + rValues[nN] = rAny; + ++nN; + } + } + //reduce to real property count + rNames.realloc(nN); + rValues.realloc(nN); +} + +uno::Any* PropertyMapper::getValuePointer( tAnySequence& rPropValues + , const tNameSequence& rPropNames + , const rtl::OUString& rPropName ) +{ + sal_Int32 nCount = rPropNames.getLength(); + for( sal_Int32 nN = 0; nN < nCount; nN++ ) + { + if(rPropNames[nN].equals(rPropName)) + return &rPropValues[nN]; + } + return NULL; +} + +/* +//set some properties from service style::CharacterProperties: +//-------- tabpage: Zeichen ----------- +//Schriftart z.B. Albany UNO_NAME_EDIT_CHAR_FONTNAME == UNO_NAME_EDIT_CHAR_FONTSTYLENAME //UNO_NAME_CHAR_FONT +//Schriftschnitt z.B. kursiv UNO_NAME_EDIT_CHAR_POSTURE UNO_NAME_CHAR_POSTURE awt::FontSlant NONE OBLIQUE ITALIC DONTKNOW REVERSE_OBLIQUE REVERSE_ITALIC +//Schriftgrad (Punktgrsse z.B. 12) UNO_NAME_EDIT_CHAR_HEIGHT == UNO_NAME_CHAR_HEIGHT + //? UNO_NAME_EDIT_CHAR_WEIGHT == UNO_NAME_CHAR_WEIGHT +//Sprache UNO_NAME_EDIT_CHAR_LOCALE lang::Locale + +//-------- tabpage: Schrifteffekt ----------- +//Unterstreichung UNO_NAME_CHAR_UNDERLINE sal_Int16 awt::FontUnderline_NONE _SINGLE _DOUBLE _DOTTED _DONTKNOW _DASH ... +//Unterstreichung-farbe ??? 'CharUnderlineColor' + CharUnderlineHasColor +//Durchstreichung z.B. doppelt "CharStrikeout" sal_Int16 awt::FontStrikeout_NONE _SINGLE _DOUBLE ... +//wortweise-Durchstreichung ja/nein "CharWordMode" bool +//Schriftfarbe UNO_NAME_EDIT_CHAR_COLOR sal_Int32 UNO_NAME_CHAR_COLOR +//ReliefArt ohne/erhaben/tief "CharRelief" sal_Int16 text::FontRelief_NONE FontRelief_EMBOSSED FontRelief_ENGRAVED +//Kontur "CharContoured" bool +//Schatten UNO_NAME_CHAR_SHADOWED bool +*/ + +//static +const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProperties() +{ + //shape property -- chart model object property + static tMakePropertyNameMap m_aShapePropertyMapForCharacterProperties = + tMakePropertyNameMap + ( C2U( "CharFontName" ), C2U("CharFontName") ) + ( C2U( "CharFontStyleName" ), C2U("CharFontStyleName") ) + ( C2U( "CharFontFamily" ), C2U("CharFontFamily") ) + ( C2U( "CharFontCharSet" ), C2U("CharFontCharSet") ) + ( C2U( "CharFontPitch" ), C2U("CharFontPitch") ) + ( C2U( "CharColor" ), C2U("CharColor") ) +// ( C2U( "CharBackColor" ), C2U("TextBackgroundColor") ) + ( C2U( "CharEscapement" ), C2U("CharEscapement") ) + ( C2U( "CharHeight" ), C2U("CharHeight") ) + ( C2U( "CharUnderline" ), C2U("CharUnderline") ) + ( C2U( "CharUnderlineColor" ), C2U("CharUnderlineColor") ) + ( C2U( "CharUnderlineHasColor" ), C2U("CharUnderlineHasColor") ) + ( C2U( "CharWeight" ), C2U("CharWeight") ) + ( C2U( "CharPosture" ), C2U("CharPosture") ) + ( C2U( "CharKerning" ), C2U("CharKerning") ) +// ( C2U( "CharCaseMap" ), C2U("CaseMapping") ) +// ( C2U( "CharRotation" ), C2U("Rotation") ) --> additional feature ... +// ( C2U( "CharScaleWidth" ), C2U("CharScaleWidth") ) +// ( C2U( "CharEscapementHeight" ), C2U("EscapementHeight") ) -> assertion +/////// ( C2U( "CharCrossedOut" ), C2U("CharCrossedOut") ) //setting this explicitly somehow conflicts with CharStrikeout + ( C2U( "CharStrikeout" ), C2U("CharStrikeout") ) + ( C2U( "CharWordMode" ), C2U("CharWordMode") ) +// ( C2U( "CharFlash" ), C2U("Flashing") ) + ( C2U( "CharLocale" ), C2U("CharLocale") ) + ( C2U( "CharShadowed" ), C2U("CharShadowed") ) + ( C2U( "CharContoured" ), C2U("CharContoured") ) + ( C2U( "CharRelief" ), C2U("CharRelief") ) + ( C2U( "CharEmphasis" ), C2U("CharEmphasis") )//the service style::CharacterProperties describes a property called 'CharEmphasize' wich is nowhere implemented +// ( C2U( "RubyText" ), C2U("RubyText") ) +// ( C2U( "RubyAdjust" ), C2U("RubyAdjust") ) +// ( C2U( "RubyCharStyleName" ), C2U("RubyStyleName") ) +// ( C2U( "RubyIsAbove" ), C2U("RubyIsAbove") ) +// ( C2U( "CharNoHyphenation" ), C2U("InhibitHyphenation") ) + ( C2U( "CharFontStyleNameAsian" ), C2U("CharFontNameAsian") ) + ( C2U( "CharFontStyleNameAsian" ), C2U("CharFontStyleNameAsian") ) + ( C2U( "CharFontFamilyAsian" ), C2U("CharFontFamilyAsian") ) + ( C2U( "CharFontCharSetAsian" ), C2U("CharFontCharSetAsian") ) + ( C2U( "CharFontPitchAsian" ), C2U("CharFontPitchAsian") ) + ( C2U( "CharHeightAsian" ), C2U("CharHeightAsian") ) + ( C2U( "CharWeightAsian" ), C2U("CharWeightAsian") ) + ( C2U( "CharPostureAsian" ), C2U("CharPostureAsian") ) + ( C2U( "CharLocaleAsian" ), C2U("CharLocaleAsian") ) + + ( C2U( "CharFontStyleNameComplex" ), C2U("CharFontNameComplex") ) + ( C2U( "CharFontStyleNameComplex" ), C2U("CharFontStyleNameComplex") ) + ( C2U( "CharFontFamilyComplex" ), C2U("CharFontFamilyComplex") ) + ( C2U( "CharFontCharSetComplex" ), C2U("CharFontCharSetComplex") ) + ( C2U( "CharFontPitchComplex" ), C2U("CharFontPitchComplex") ) + ( C2U( "CharHeightComplex" ), C2U("CharHeightComplex") ) + ( C2U( "CharWeightComplex" ), C2U("CharWeightComplex") ) + ( C2U( "CharPostureComplex" ), C2U("CharPostureComplex") ) + ( C2U( "CharLocaleComplex" ), C2U("CharLocaleComplex") ) + ; + return m_aShapePropertyMapForCharacterProperties; +} + +//static +const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForParagraphProperties() +{ + //shape property -- chart model object property + static tMakePropertyNameMap m_aShapePropertyMapForParagraphProperties = + tMakePropertyNameMap + ( C2U( "ParaAdjust" ), C2U("ParaAdjust") ) + ( C2U( "ParaLastLineAdjust" ), C2U("ParaLastLineAdjust") ) + ( C2U( "ParaLeftMargin" ), C2U("ParaLeftMargin") ) + ( C2U( "ParaRightMargin" ), C2U("ParaRightMargin") ) + ( C2U( "ParaTopMargin" ), C2U("ParaTopMargin") ) + ( C2U( "ParaBottomMargin" ), C2U("ParaBottomMargin") ) + ( C2U( "ParaIsHyphenation" ), C2U("ParaIsHyphenation") ) + ; + return m_aShapePropertyMapForParagraphProperties; +} + +//static +const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFillProperties() +{ + //shape property -- chart model object property + static tMakePropertyNameMap m_aShapePropertyMapForFillProperties = + tMakePropertyNameMap + ( C2U( "FillStyle" ), C2U("FillStyle") ) + ( C2U( "FillColor" ), C2U("FillColor") ) + ( C2U( "FillTransparence" ), C2U("FillTransparence") ) + ( C2U( "FillGradient" ), C2U("FillGradient") ) + ( C2U( "FillHatch" ), C2U("FillHatch") ) +// ( C2U( "FillTransparenceGradientName" ), C2U("TransparencyStyle") ) //@todo this property name seems to be wrong in chart model +// ( C2U( "FillTransparenceGradient" ), C2U("TransparencyGradient") ) //@todo this property name seems to be wrong in chart model + ; + return m_aShapePropertyMapForFillProperties; +} + +//static +const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForLineProperties() +{ + //shape property -- chart model object property + static tMakePropertyNameMap m_aShapePropertyMapForLineProperties = + tMakePropertyNameMap + ( C2U( "LineStyle" ), C2U("LineStyle") ) + ( C2U( "LineWidth" ), C2U("LineWidth") ) + ( C2U( "LineDash" ), C2U("LineDash") ) + ( C2U( "LineColor" ), C2U("LineColor") ) + ( C2U( "LineTransparence" ), C2U("LineTransparence") ) + ( C2U( "LineJoint" ), C2U("LineJoint") ) + ; + return m_aShapePropertyMapForLineProperties; +} + +//static +void PropertyMapper::setMultiProperties( + const tNameSequence& rNames + , const tAnySequence& rValues + , const uno::Reference< drawing::XShape >& xTarget ) +{ + try + { + uno::Reference< beans::XMultiPropertySet > xShapeMultiProp( xTarget, uno::UNO_QUERY ); + if( xShapeMultiProp.is() ) + { + xShapeMultiProp->setPropertyValues( rNames,rValues ); + } + else + { + //@todo: if no multipropertyset is available try the unperformant normal XPropertySet + } + } + catch( uno::Exception& e ) + { + e; + } +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx new file mode 100644 index 000000000000..68fde4dcf069 --- /dev/null +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -0,0 +1,1978 @@ +/************************************************************************* + * + * $RCSfile: ShapeFactory.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "ShapeFactory.hxx" +#include "ViewDefines.hxx" +#include "Stripe.hxx" +#include "CommonConverters.hxx" +#include "macros.hxx" +#include "InlineContainer.hxx" +#include "PropertyMapper.hxx" + +/* +#ifndef _E3D_EXTRUD3D_HXX +#include <svx/extrud3d.hxx> +#endif +*/ + +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +/* +#ifndef _COM_SUN_STAR_DRAWING_CAMERAGEOMETRY_HPP_ +#include <com/sun/star/drawing/CameraGeometry.hpp> +#endif +*/ +#ifndef _COM_SUN_STAR_DRAWING_CIRCLEKIND_HPP_ +#include <com/sun/star/drawing/CircleKind.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_DOUBLESEQUENCE_HPP_ +#include <com/sun/star/drawing/DoubleSequence.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_FLAGSEQUENCE_HPP_ +#include <com/sun/star/drawing/FlagSequence.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_LINESTYLE_HPP_ +#include <com/sun/star/drawing/LineStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_NORMALSKIND_HPP_ +#include <com/sun/star/drawing/NormalsKind.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_POINTSEQUENCE_HPP_ +#include <com/sun/star/drawing/PointSequence.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_POLYGONKIND_HPP_ +#include <com/sun/star/drawing/PolygonKind.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_POLYPOLYGONBEZIERCOORDS_HPP_ +#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_PROJECTIONMODE_HPP_ +#include <com/sun/star/drawing/ProjectionMode.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_SHADEMODE_HPP_ +#include <com/sun/star/drawing/ShadeMode.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_TEXTFITTOSIZETYPE_HPP_ +#include <com/sun/star/drawing/TextFitToSizeType.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_TEXTVERTICALADJUST_HPP_ +#include <com/sun/star/drawing/TextVerticalAdjust.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_TEXTHORIZONTALADJUST_HPP_ +#include <com/sun/star/drawing/TextHorizontalAdjust.hpp> +#endif +#ifndef _COM_SUN_STAR_TEXT_XTEXT_HPP_ +#include <com/sun/star/text/XText.hpp> +#endif +/* +#ifndef _COM_SUN_STAR_DRAWING_TEXTUREMODE_HPP_ +#include <com/sun/star/drawing/TextureMode.hpp> +#endif +*/ + +//only test +/* +#ifndef _COM_SUN_STAR_AWT_FONTSTRIKEOUT_HPP_ +#include <com/sun/star/awt/FontStrikeout.hpp> +#endif +#ifndef _COM_SUN_STAR_TEXT_FONTEMPHASIS_HPP_ +#include <com/sun/star/text/FontEmphasis.hpp> +#endif +#ifndef _COM_SUN_STAR_CONTAINER_XENUMERATION_HPP_ +#include <com/sun/star/container/XEnumeration.hpp> +#endif +#ifndef _COM_SUN_STAR_CONTAINER_XENUMERATIONACCESS_HPP_ +#include <com/sun/star/container/XEnumerationAccess.hpp> +#endif +*/ + +#ifndef _COM_SUN_STAR_UNO_ANY_HXX_ +#include <com/sun/star/uno/Any.hxx> +#endif + + +#ifndef _SVX_UNOPRNMS_HXX +#include <svx/unoprnms.hxx> +#endif +#ifndef _TOOLS_COLOR_HXX +#include <tools/color.hxx> +#endif +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif + +#ifndef INCLUDED_RTL_MATH_HXX +#include <rtl/math.hxx> +#endif + +#ifndef _XPOLY_HXX +#include <svx/xpoly.hxx> +#endif +#ifndef _SVDOCIRC_HXX +#include <svx/svdocirc.hxx> +#endif +#ifndef _SVDOPATH_HXX +#include <svx/svdopath.hxx> +#endif + +#include <algorithm> + +using namespace ::com::sun::star; + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// set a name/CID at a shape (is used for selection handling) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +//static +void ShapeFactory::setShapeName( const uno::Reference< drawing::XShape >& xShape + , const rtl::OUString& rName ) +{ + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + xProp->setPropertyValue( C2U( UNO_NAME_MISC_OBJ_NAME ) + , uno::makeAny( rName ) ); + } + catch( uno::Exception& e ) + { + e; + } + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// set appearance properties at a shape +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +//static +void ShapeFactory::setShapeAppearance( + const ShapeAppearance& rAppearance + , const uno::Reference< beans::XPropertySet >& xProp + , sal_Bool bNoLines ) + throw (beans::UnknownPropertyException + , beans::PropertyVetoException + , lang::IllegalArgumentException + , lang::WrappedTargetException + , uno::RuntimeException) +{ + //LineStyle + if(bNoLines) + { + xProp->setPropertyValue( C2U( UNO_NAME_LINESTYLE ) + , uno::makeAny(drawing::LineStyle_NONE) ); + } + //FillColor + xProp->setPropertyValue( C2U( UNO_NAME_FILLCOLOR ) + , uno::makeAny(rAppearance.m_nColorData) ); + //Transparency + xProp->setPropertyValue( C2U( UNO_NAME_FILL_TRANSPARENCE ) + , uno::makeAny( (sal_Int16)rAppearance.m_nTransparency ) ); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// diverse PolyPolygon create methods +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +uno::Any createPolyPolygon_Cube( + const drawing::Direction3D& rSize, double fRoundedEdge, sal_Bool bRounded = true ) +{ + DBG_ASSERT(fRoundedEdge>=0, "fRoundedEdge needs to be >= 0"); + + // always use extra points, so set percent diagonal to 0.4 which is 0% in the UI (old Chart comment) + if( fRoundedEdge == 0.0 && bRounded) + fRoundedEdge = 0.4 / 200.0; + else if(!bRounded) + fRoundedEdge = 0.0; + + const double fWidthH = rSize.DirectionX/2.0; //fWidthH stands for Half Width + const double fHeight = rSize.DirectionY; + const double fDepth = rSize.DirectionZ; + + const double fOffset = (fDepth * fRoundedEdge) * 1.05; // increase by 5% for safety + const bool bRoundEdges = fRoundedEdge && fOffset < fWidthH && 2.0 * fOffset < fHeight; + const sal_Int32 nPointCount = bRoundEdges ? 13 : 5; + + //-------------------------------------- + drawing::PolyPolygonShape3D aPP; + + aPP.SequenceX.realloc(1); + aPP.SequenceY.realloc(1); + aPP.SequenceZ.realloc(1); + + drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray(); + drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray(); + drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray(); + + pOuterSequenceX->realloc(nPointCount); + pOuterSequenceY->realloc(nPointCount); + pOuterSequenceZ->realloc(nPointCount); + + double* pInnerSequenceX = pOuterSequenceX->getArray(); + double* pInnerSequenceY = pOuterSequenceY->getArray(); + double* pInnerSequenceZ = pOuterSequenceZ->getArray(); + + for(sal_Int32 nN = nPointCount; nN--;) + *pInnerSequenceZ++ = 0.0; + //*pInnerSequenceZ++ = -fDepth/2.0; + + if(nPointCount == 5) + { + *pInnerSequenceY++ = 0.0; + *pInnerSequenceY++ = fHeight; + *pInnerSequenceY++ = fHeight; + *pInnerSequenceY++ = 0.0; + *pInnerSequenceY++ = 0.0; + + *pInnerSequenceX++ = -fWidthH; + *pInnerSequenceX++ = -fWidthH; + *pInnerSequenceX++ = fWidthH; + *pInnerSequenceX++ = fWidthH; + *pInnerSequenceX++ = -fWidthH; + } + else + { + *pInnerSequenceY++ = 0.0; //1. + *pInnerSequenceY++ = 0.0; + *pInnerSequenceY++ = fOffset; + *pInnerSequenceY++ = fHeight - fOffset; + *pInnerSequenceY++ = fHeight; + *pInnerSequenceY++ = fHeight; //6. + *pInnerSequenceY++ = fHeight; + *pInnerSequenceY++ = fHeight; + *pInnerSequenceY++ = fHeight - fOffset; + *pInnerSequenceY++ = fOffset; //10. + *pInnerSequenceY++ = 0.0; + *pInnerSequenceY++ = 0.0; + *pInnerSequenceY++ = 0.0; + + + *pInnerSequenceX++ = -fWidthH + fOffset; //1. + *pInnerSequenceX++ = -fWidthH; + *pInnerSequenceX++ = -fWidthH; + *pInnerSequenceX++ = -fWidthH; + *pInnerSequenceX++ = -fWidthH; + *pInnerSequenceX++ = -fWidthH + fOffset; //6. + *pInnerSequenceX++ = fWidthH - fOffset; + *pInnerSequenceX++ = fWidthH; + *pInnerSequenceX++ = fWidthH; + *pInnerSequenceX++ = fWidthH; //10. + *pInnerSequenceX++ = fWidthH; + *pInnerSequenceX++ = fWidthH - fOffset; + *pInnerSequenceX++ = -fWidthH + fOffset; + } + return uno::Any( &aPP, ::getCppuType((const drawing::PolyPolygonShape3D*)0) ); +} + +uno::Any createPolyPolygon_Cylinder( + double fHeight + , double fRadius + , double fRoundedEdge ) +{ + //@todo consider offset if Height is negative + +// DBG_ASSERT(fHeight>0, "The height of a cylinder needs to be > 0"); + DBG_ASSERT(fRadius>0, "The radius of a cylinder needs to be > 0"); + DBG_ASSERT(fRoundedEdge>=0, "fRoundedEdge needs to be >= 0"); + + // always use extra points, so set percent diagonal to 0.4 which is 0% in the UI (old Chart comment) + if( fRoundedEdge == 0.0 ) + fRoundedEdge = 0.4 / 200.0; + + const double fWidth = fRadius; + + const double fOffset = (fRadius * 2.0 * fRoundedEdge) * 1.05; // increase by 5% for safety + const bool bRoundEdges = fRoundedEdge && fOffset < fRadius && 2.0 * fOffset < fHeight; + const sal_Int32 nPointCount = bRoundEdges ? 8 : 4; + + //-------------------------------------- + drawing::PolyPolygonShape3D aPP; + + aPP.SequenceX.realloc(1); + aPP.SequenceY.realloc(1); + aPP.SequenceZ.realloc(1); + + drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray(); + drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray(); + drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray(); + + pOuterSequenceX->realloc(nPointCount); + pOuterSequenceY->realloc(nPointCount); + pOuterSequenceZ->realloc(nPointCount); + + double* pInnerSequenceX = pOuterSequenceX->getArray(); + double* pInnerSequenceY = pOuterSequenceY->getArray(); + double* pInnerSequenceZ = pOuterSequenceZ->getArray(); + + for(sal_Int32 nN = nPointCount; nN--;) + *pInnerSequenceZ++ = 0.0; + + if(nPointCount == 4) + { + *pInnerSequenceY++ = 0.0; + *pInnerSequenceY++ = 0.0; + *pInnerSequenceY++ = fHeight; + *pInnerSequenceY++ = fHeight; + + *pInnerSequenceX++ = 0.0; + *pInnerSequenceX++ = fRadius; + *pInnerSequenceX++ = fRadius; + *pInnerSequenceX++ = 0.0; + } + else + { + *pInnerSequenceY++ = 0.0; //1. + *pInnerSequenceY++ = 0.0; + *pInnerSequenceY++ = 0.0; + *pInnerSequenceY++ = fOffset; + *pInnerSequenceY++ = fHeight - fOffset; + *pInnerSequenceY++ = fHeight; //6. + *pInnerSequenceY++ = fHeight; + *pInnerSequenceY++ = fHeight; + + *pInnerSequenceX++ = 0.0; //1. + *pInnerSequenceX++ = fRadius - fOffset; + *pInnerSequenceX++ = fRadius; + *pInnerSequenceX++ = fRadius; + *pInnerSequenceX++ = fRadius; + *pInnerSequenceX++ = fRadius; //6. + *pInnerSequenceX++ = fRadius - fOffset; + *pInnerSequenceX++ = 0.0; + } + return uno::Any( &aPP, ::getCppuType((const drawing::PolyPolygonShape3D*)0) ); +} + +uno::Any createPolyPolygon_Cone( + double fHeight + , double fRadius + , double fTopHeight + , double fRoundedEdge) +{ + //@todo consider offset if Height is negative +/* + DBG_ASSERT(fHeight>0, "The height of a cone needs to be > 0"); + DBG_ASSERT(fTopHeight>=0, "The height of the cutted top of a cone needs to be >= 0"); +*/ + + DBG_ASSERT(fRadius>0, "The radius of a cone needs to be > 0"); + DBG_ASSERT(fRoundedEdge>=0, "fRoundedEdge needs to be >= 0"); + + //for stacked charts we need cones without top -> fTopHeight != 0 resp. bTopless == true + //fTopHeight indicates the high of the cutted top only (not the full height) + + // always use extra points, so set percent diagonal to 0.4 which is 0% in the UI (old Chart comment) + if( fRoundedEdge == 0.0 ) + fRoundedEdge = 0.4 / 200.0; + + fRoundedEdge = 0.0; + + BOOL bTopless = fTopHeight != 0.0; + + double r1= 0.0, r2 = fRadius; + if(bTopless) + r1 = fRadius * (fTopHeight)/(fHeight+fTopHeight); + + const double fMinimumDimension = ::std::min(r2*2.0,fHeight); + const double fOffset = (fMinimumDimension * fRoundedEdge) * 1.05; // increase by 5% for safety + const bool bRoundEdges = fRoundedEdge && fOffset < r2 && 2.0 * fOffset < fHeight + && ( bTopless ? fOffset < r1 : true ); + sal_Int32 nPointCount = 8; + if(bTopless) + { + if(!bRoundEdges) + nPointCount = 4; + } + else + { + if(bRoundEdges) + nPointCount = 6; + else + nPointCount = 3; + } + + //-------------------------------------- + drawing::PolyPolygonShape3D aPP; + + aPP.SequenceX.realloc(1); + aPP.SequenceY.realloc(1); + aPP.SequenceZ.realloc(1); + + drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray(); + drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray(); + drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray(); + + pOuterSequenceX->realloc(nPointCount); + pOuterSequenceY->realloc(nPointCount); + pOuterSequenceZ->realloc(nPointCount); + + double* pInnerSequenceX = pOuterSequenceX->getArray(); + double* pInnerSequenceY = pOuterSequenceY->getArray(); + double* pInnerSequenceZ = pOuterSequenceZ->getArray(); + + for(sal_Int32 nN = nPointCount; nN--;) + *pInnerSequenceZ++ = 0.0; + + if(bTopless) + { + *pInnerSequenceY++ = fHeight; //1. + *pInnerSequenceX++ = 0.0; //1. + + if(bRoundEdges) + { + *pInnerSequenceY++ = fHeight; //2. + *pInnerSequenceX++ = r1 - fOffset; //2. + } + } + + *pInnerSequenceY++ = fHeight; //3. + *pInnerSequenceX++ = r1; //3. + + if(bRoundEdges) + { + *pInnerSequenceY++ = fHeight - fOffset; //4. + *pInnerSequenceX++ = r1 + fOffset; //4. + + *pInnerSequenceY++ = fOffset; //5. + *pInnerSequenceX++ = r2 - fOffset; //5. + } + + *pInnerSequenceY++ = 0.0; //6. + *pInnerSequenceX++ = r2; //6. + + if(bRoundEdges) + { + *pInnerSequenceY++ = 0.0; //7. + *pInnerSequenceX++ = r2 - fOffset; //7. + } + + *pInnerSequenceY++ = 0.0; //8. + *pInnerSequenceX++ = 0.0; //8. + + return uno::Any( &aPP, ::getCppuType((const drawing::PolyPolygonShape3D*)0) ); +} + +uno::Any createPolyPolygon_PieSegment( + double fHeight + , double fXWidthRadius + , double fInnerXRadius = 0.0) +{ + DBG_ASSERT(fHeight>0, "The height of a pie segment needs to be > 0"); + DBG_ASSERT(fInnerXRadius>=0, "The inner radius of a pie segment needs to be >= 0"); + DBG_ASSERT(fXWidthRadius>0, "The width radius of a pie segment needs to be > 0"); + + const BOOL bClosed = true; + + const sal_Int32 nPointCount = bClosed ? 5 : 4; + + //-------------------------------------- + drawing::PolyPolygonShape3D aPP; + + aPP.SequenceX.realloc(1); + aPP.SequenceY.realloc(1); + aPP.SequenceZ.realloc(1); + + drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray(); + drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray(); + drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray(); + + pOuterSequenceX->realloc(nPointCount); + pOuterSequenceY->realloc(nPointCount); + pOuterSequenceZ->realloc(nPointCount); + + double* pInnerSequenceX = pOuterSequenceX->getArray(); + double* pInnerSequenceY = pOuterSequenceY->getArray(); + double* pInnerSequenceZ = pOuterSequenceZ->getArray(); + + for(sal_Int32 nN = nPointCount; nN--;) + *pInnerSequenceZ++ = 0.0; + + *pInnerSequenceY++ = 0.0; + *pInnerSequenceY++ = 0.0; + *pInnerSequenceY++ = fHeight; + *pInnerSequenceY++ = fHeight; + if(bClosed) + *pInnerSequenceY++ = 0.0; + + *pInnerSequenceX++ = fInnerXRadius; + *pInnerSequenceX++ = fInnerXRadius+fXWidthRadius; + *pInnerSequenceX++ = fInnerXRadius+fXWidthRadius; + *pInnerSequenceX++ = fInnerXRadius; + if(bClosed) + *pInnerSequenceX++ = fInnerXRadius; + + return uno::Any( &aPP, ::getCppuType((const drawing::PolyPolygonShape3D*)0) ); +} + + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +// methods for 3D shape creation +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- + +uno::Reference<drawing::XShape> + ShapeFactory::createCube( + const uno::Reference<drawing::XShapes>& xTarget + , const DataPointGeometry& rGeometry + , const ShapeAppearance& rAppearance) +{ + uno::Reference<drawing::XShape> xShape = impl_createCube( xTarget, rGeometry, FALSE ); + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + ShapeFactory::setShapeAppearance( rAppearance, xProp ); + return xShape; +} + +uno::Reference<drawing::XShape> + ShapeFactory::createRoundedCube( + const uno::Reference<drawing::XShapes>& xTarget + , const DataPointGeometry& rGeometry ) +{ + return impl_createCube( xTarget, rGeometry, TRUE); +} + +uno::Reference<drawing::XShape> + ShapeFactory::impl_createCube( + const uno::Reference<drawing::XShapes>& xTarget + , const DataPointGeometry& rGeometry + //, const ShapeAppearance& rAppearance + , sal_Bool bRounded ) +{ + //create shape + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.Shape3DExtrudeObject") ), uno::UNO_QUERY ); + xTarget->add(xShape); + + //set properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + //depth + xProp->setPropertyValue( C2U( UNO_NAME_3D_EXTRUDE_DEPTH ) + , uno::makeAny((sal_Int32)rGeometry.m_aSize.DirectionZ) ); + + //PercentDiagonal + sal_Int16 nPercentDiagonal = bRounded ? 5 : 0; + xProp->setPropertyValue( C2U( UNO_NAME_3D_PERCENT_DIAGONAL ) + , uno::makeAny( nPercentDiagonal ) ); + + //Polygon + xProp->setPropertyValue( C2U( UNO_NAME_3D_POLYPOLYGON3D ) + , createPolyPolygon_Cube( rGeometry.m_aSize, double(nPercentDiagonal)/200.0,bRounded) ); + + //Matrix for position + { + Matrix4D aM4; + aM4.Translate(rGeometry.m_aPosition.PositionX + , rGeometry.m_aPosition.PositionY + , rGeometry.m_aPosition.PositionZ - (rGeometry.m_aSize.DirectionZ/2.0)); + drawing::HomogenMatrix aHM = Matrix4DToHomogenMatrix(aM4); + xProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX ) + , uno::makeAny(aHM) ); + } + } + catch( uno::Exception& e ) + { + e; + } + } + return xShape; +} + +uno::Reference<drawing::XShape> + ShapeFactory::createCylinder( + const uno::Reference<drawing::XShapes>& xTarget + , const DataPointGeometry& rGeometry ) +{ + return impl_createConeOrCylinder( + xTarget, rGeometry, CHART_3DOBJECT_SEGMENTCOUNT, true ); +} + +uno::Reference<drawing::XShape> + ShapeFactory::createPyramid( + const uno::Reference<drawing::XShapes>& xTarget + , const DataPointGeometry& rGeometry ) +{ + return impl_createConeOrCylinder( xTarget, rGeometry, 4 ); +} + +uno::Reference<drawing::XShape> + ShapeFactory::createCone( + const uno::Reference<drawing::XShapes>& xTarget + , const DataPointGeometry& rGeometry ) +{ + return impl_createConeOrCylinder( xTarget, rGeometry, CHART_3DOBJECT_SEGMENTCOUNT ); +} + +uno::Reference<drawing::XShape> + ShapeFactory::impl_createConeOrCylinder( + const uno::Reference<drawing::XShapes>& xTarget + , const DataPointGeometry& rGeometry + , sal_Int32 nSegments + , bool bCylinder ) +{ + + static int ntest = 0; + ntest++; + + //create shape + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.Shape3DLatheObject") ), uno::UNO_QUERY ); + xTarget->add(xShape); + + + double fYRotateAnglePi = -ZDIRECTION*(F_PI/2.0 - F_PI/(double)nSegments); // alwayas rotate edge to front (important for pyramids) + //or: ZDIRECTION*(F_PI/2.0 - F_PI/(double)nSegments); // rotate edge to front for even segment count otherwise rotate corner to front + double fAngle = fYRotateAnglePi; + { + while(fAngle<0.0) + fAngle+=F_PI/2.0; + while(fAngle>F_PI/2.0) + fAngle-=F_PI/2.0; + } + //double fWidth = ::std::min( rGeometry.m_aSize.DirectionX, rGeometry.m_aSize.DirectionZ )/2.0; + double fWidth = rGeometry.m_aSize.DirectionX/2.0; //The depth will be corrrected within Matrix + double fRadius = fWidth; //!!!!!!!! problem in drawing layer: rotation object calculates wrong needed size -> wrong camera (it's a problem with bounding boxes) +// double fRadius = fWidth/cos(fAngle); llllllllllllllllllll + double fHeight = rGeometry.m_aSize.DirectionY; + //for Cones: + double fTopHeight = rGeometry.m_aSize2.DirectionY; + + //set properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + //UNO_NAME_3D_TRANSFORM_MATRIX drawing::HomogenMatrix + //UNO_NAME_3D_POLYPOLYGON3D PolyPolygonShape3D + //UNO_NAME_3D_LATHE_END_ANGLE sal_Int16 + //UNO_NAME_3D_HORZ_SEGS sal_Int32 + //UNO_NAME_3D_PERCENT_DIAGONAL sal_Int16 + //UNO_NAME_3D_VERT_SEGS sal_Int32 + + //PercentDiagonal + sal_Int16 nPercentDiagonal = 5; + xProp->setPropertyValue( C2U( UNO_NAME_3D_PERCENT_DIAGONAL ) + , uno::makeAny( nPercentDiagonal ) ); + + //Polygon + uno::Any aPPolygon = bCylinder ? createPolyPolygon_Cylinder( + fHeight, fRadius, double(nPercentDiagonal)/200.0) + : createPolyPolygon_Cone( + fHeight, fRadius, fTopHeight, double(nPercentDiagonal)/200.0); + xProp->setPropertyValue( C2U( UNO_NAME_3D_POLYPOLYGON3D ), aPPolygon ); + + //Matrix for position + { + Matrix4D aM4; + //if(ntest%2) //llllllllllllllllllll + //aM4.RotateY( fYRotateAnglePi ); + + // Note: Uncomment the following to let the objects grow in z + // direction to fill the diagram +// aM4.ScaleZ(rGeometry.m_aSize.DirectionZ/rGeometry.m_aSize.DirectionX); + aM4.Translate(rGeometry.m_aPosition.PositionX, rGeometry.m_aPosition.PositionY, rGeometry.m_aPosition.PositionZ); + drawing::HomogenMatrix aHM = Matrix4DToHomogenMatrix(aM4); + xProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX ) + , uno::makeAny(aHM) ); + } + + //Segments + xProp->setPropertyValue( C2U( UNO_NAME_3D_VERT_SEGS ) + , uno::makeAny(CHART_3DOBJECT_SEGMENTCOUNT) ); + xProp->setPropertyValue( C2U( UNO_NAME_3D_HORZ_SEGS ) + , uno::makeAny(nSegments) ); + +//// ShapeFactory::setShapeAppearance( rAppearance, xProp ); + } + catch( uno::Exception& e ) + { + e; + } + } + return xShape; +} + +void appendBezierCoords( drawing::PolyPolygonBezierCoords& rReturn, const drawing::PolyPolygonBezierCoords& rAdd, sal_Bool bAppendInverse ) +{ + if(!rAdd.Coordinates.getLength()) + return; + sal_Int32 nAddCount = rAdd.Coordinates[0].getLength(); + if(!nAddCount) + return; + + sal_Int32 nOldCount = rReturn.Coordinates[0].getLength(); + + rReturn.Coordinates[0].realloc(nOldCount+nAddCount); + rReturn.Flags[0].realloc(nOldCount+nAddCount); + + for(sal_Int32 nN=0;nN<nAddCount; nN++ ) + { + sal_Int32 nAdd = bAppendInverse ? (nAddCount-1-nN) : nN; + rReturn.Coordinates[0][nOldCount+nN] = rAdd.Coordinates[0][nAdd]; + rReturn.Flags[0][nOldCount+nN] = rAdd.Flags[0][nAdd]; + } +} + +drawing::PolyPolygonBezierCoords getCircularArcBezierCoords( + double fAngleRadian + , const Matrix3D& rTransformationFromUnitCircle ) +{ + //at least one polygon is created using two normal and two control points + //if the angle is larger it is separated into multiple sub angles + + const double fSmallAngleRadian = F_PI/10.0; + + drawing::PolyPolygonBezierCoords aReturn = drawing::PolyPolygonBezierCoords(); + sal_Int32 nSegmentCount = fAngleRadian/fSmallAngleRadian; + if( fAngleRadian > fSmallAngleRadian*nSegmentCount ) + nSegmentCount++; + + sal_Int32 nPointCount = 1 + 3*nSegmentCount; //first point of next segment equals last point of former segment + + aReturn.Coordinates = drawing::PointSequenceSequence(1); + aReturn.Flags = drawing::FlagSequenceSequence(1); + + drawing::PointSequence aPoints(nPointCount); + drawing::FlagSequence aFlags(nPointCount); + + // + + Vector2D P0,P1,P2,P3; + Vector2D POrigin = rTransformationFromUnitCircle*Vector2D(0,0); + + sal_Int32 nPoint=0; + for(sal_Int32 nSegment=0; nSegment<nSegmentCount; nSegment++) + { + double fCurrentSegmentAngle = fSmallAngleRadian; + //the last segment gets the rest angle that does not fit into equal pieces + if(nSegment==(nSegmentCount-1)) + fCurrentSegmentAngle = fAngleRadian - fSmallAngleRadian*(nSegmentCount-1); + + //first create untransformed points for a unit circle arc: + const double fCos = cos(fCurrentSegmentAngle/2.0); + const double fSin = sin(fCurrentSegmentAngle/2.0); + P0.X() = P3.X() = fCos; + P0.Y() = -fSin; + P3.Y() = -P0.Y(); + + P1.X() = P2.X() = (4.0-fCos)/3.0; + P1.Y() = (1.0-fCos)*(fCos-3.0)/(3.0*fSin); + P2.Y() = -P1.Y(); + //transform thus startangle equals NULL + Matrix3D aStart; + aStart.Rotate(fCurrentSegmentAngle/2.0 + nSegment*fSmallAngleRadian); + + //apply given transformation to get final points + P0 = rTransformationFromUnitCircle*(aStart*P0); + P1 = rTransformationFromUnitCircle*(aStart*P1); + P2 = rTransformationFromUnitCircle*(aStart*P2); + P3 = rTransformationFromUnitCircle*(aStart*P3); + + aPoints[nPoint].X = P0.X(); + aPoints[nPoint].Y = P0.Y(); + aFlags [nPoint++] = drawing::PolygonFlags_NORMAL; + + aPoints[nPoint].X = P1.X(); + aPoints[nPoint].Y = P1.Y(); + aFlags[nPoint++] = drawing::PolygonFlags_CONTROL; + + aPoints[nPoint].X = P2.X(); + aPoints[nPoint].Y = P2.Y(); + aFlags [nPoint++] = drawing::PolygonFlags_CONTROL; + + if(nSegment==(nSegmentCount-1)) + { + aPoints[nPoint].X = P3.X(); + aPoints[nPoint].Y = P3.Y(); + aFlags [nPoint++] = drawing::PolygonFlags_NORMAL; + } + } + + aReturn.Coordinates[0] = aPoints; + aReturn.Flags[0] = aFlags; + + return aReturn; +} + +drawing::PolyPolygonBezierCoords getRingBezierCoords( + double fInnerXRadius + , double fOuterXRadius, double fOuterYRadius + , double fWidthAngleRadian, double fStartAngleRadian + , double fPosX, double fPosY ) +{ + drawing::PolyPolygonBezierCoords aReturn = drawing::PolyPolygonBezierCoords(); + + aReturn.Coordinates = drawing::PointSequenceSequence(1); + aReturn.Flags = drawing::FlagSequenceSequence(1); + + Matrix3D aTransformationFromUnitCircle_Outer; + aTransformationFromUnitCircle_Outer.Rotate(fStartAngleRadian); + aTransformationFromUnitCircle_Outer.ScaleX(fOuterXRadius); + aTransformationFromUnitCircle_Outer.ScaleY(fOuterYRadius); + aTransformationFromUnitCircle_Outer.TranslateX(fPosX); + aTransformationFromUnitCircle_Outer.TranslateY(fPosY); + + drawing::PolyPolygonBezierCoords aOuterArc = getCircularArcBezierCoords( fWidthAngleRadian, aTransformationFromUnitCircle_Outer ); + aReturn.Coordinates[0] = aOuterArc.Coordinates[0]; + aReturn.Flags[0] = aOuterArc.Flags[0]; + + Matrix3D aTransformationFromUnitCircle_Inner; + aTransformationFromUnitCircle_Inner.Rotate(fStartAngleRadian); + aTransformationFromUnitCircle_Inner.ScaleX(fInnerXRadius); + aTransformationFromUnitCircle_Inner.ScaleY(fInnerXRadius*fOuterYRadius/fOuterXRadius); + aTransformationFromUnitCircle_Inner.TranslateX(fPosX); + aTransformationFromUnitCircle_Inner.TranslateY(fPosY); + + drawing::PolyPolygonBezierCoords aInnerArc = getCircularArcBezierCoords( fWidthAngleRadian, aTransformationFromUnitCircle_Inner ); + appendBezierCoords( aReturn, aInnerArc, sal_True ); + + return aReturn; +} +/* +XPolygon ImpCalcXPoly(const Rectangle& rRect1, long nStart, long nEnd) +{ + long rx=rRect1.GetWidth()/2; // Da GetWidth()/GetHeight() jeweils 1 + long ry=rRect1.GetHeight()/2; // draufaddieren wird korrekt gerundet. + long a=0,e=3600; + { + a=nStart/10; + e=nEnd/10; + { + // Drehrichtung umkehren, damit Richtungssinn genauso wie Rechteck + rx=-rx; + a=1800-a; if (a<0) a+=3600; + e=1800-e; if (e<0) e+=3600; + long nTmp=a; + a=e; + e=nTmp; + } + } + FASTBOOL bClose=FALSE; + XPolygon aXPoly(rRect1.Center(),rx,ry,USHORT(a),USHORT(e),bClose); + if (nStart==nEnd) + { + Point aMerk(aXPoly[0]); + aXPoly=XPolygon(2); + aXPoly[0]=rRect1.Center(); + aXPoly[1]=aMerk; + } + { // Der Sektor soll Start/Ende im Zentrum haben + // Polygon um einen Punkt rotieren (Punkte im Array verschieben) + unsigned nPointAnz=aXPoly.GetPointCount(); + aXPoly.Insert(0,rRect1.Center(),XPOLY_NORMAL); + aXPoly[aXPoly.GetPointCount()]=rRect1.Center(); + } + // Die Winkelangaben beziehen sich immer auf die linke obere Ecke von !aRect! +// if (aGeo.nShearWink!=0) ShearXPoly(aXPoly,aRect.TopLeft(),aGeo.nTan); +// if (aGeo.nDrehWink!=0) RotateXPoly(aXPoly,aRect.TopLeft(),aGeo.nSin,aGeo.nCos); + return aXPoly; +} +*/ +uno::Reference< drawing::XShape > + ShapeFactory::createPieSegment2D( + const uno::Reference< drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry ) +// , const ShapeAppearance& rAppearance ) +{ + /* + DataPointGeometry aLogicGeom( drawing::Position3D(0.0,0.0,0.0) + , drawing::Direction3D(fOuterXDiameter,fOuterYDiameter,fDepth) + , drawing::Direction3D(fInnerXDiameter,fStartAngleDegree,fWidthAngleDegree) ); + */ + + double fInnerXRadius = rGeometry.m_aSize2.DirectionX/2.0; + //only test + //fInnerXRadius = 0.0; + //if( fInnerXRadius > 0.0 ) return NULL; + + double fOuterXRadius = rGeometry.m_aSize.DirectionX/2.0; + double fOuterYRadius = rGeometry.m_aSize.DirectionY/2.0; + + double fStartAngleDegree = rGeometry.m_aSize2.DirectionY; + double fWidthAngleDegree = rGeometry.m_aSize2.DirectionZ; + + /* + DBG_ASSERT(fOuterXRadius>0, "The radius of a pie needs to be > 0"); + DBG_ASSERT(fInnerXRadius>=0, "The inner radius of a pie needs to be >= 0"); + DBG_ASSERT(fOuterXRadius>fInnerXRadius, "The outer radius needs to be greater than the inner radius of a pie"); + DBG_ASSERT(fOuterYRadius>0, "The radius of a pie needs to be > 0"); + + DBG_ASSERT(fWidthAngleDegree>0, "The angle of a pie needs to be > 0"); + DBG_ASSERT(fWidthAngleDegree<=360, "The angle of a pie needs to be <= 360 degree"); + */ + + while(fWidthAngleDegree>360) + fWidthAngleDegree -= 360.0; + while(fWidthAngleDegree<0) + fWidthAngleDegree += 360.0; + + //create shape + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( +// C2U("com.sun.star.drawing.EllipseShape") ), uno::UNO_QUERY ); +// C2U("com.sun.star.drawing.PolyPolygonShape") ), uno::UNO_QUERY ); +// C2U("com.sun.star.drawing.OpenFreeHandShape") ), uno::UNO_QUERY ); + C2U("com.sun.star.drawing.ClosedBezierShape") ), uno::UNO_QUERY ); +// C2U("com.sun.star.drawing.LineShape") ), uno::UNO_QUERY ); +// C2U("com.sun.star.drawing.PolyLineShape") ), uno::UNO_QUERY ); + + //need to add the shape before setting of properties + xTarget->add(xShape); + + //need left upper corner not the middle of the circle (!! x and y are assumed to scale in the same way here) + double fXPos = rGeometry.m_aPosition.PositionX; + double fYPos = rGeometry.m_aPosition.PositionY; + + double fXSize = rGeometry.m_aSize.DirectionX; + double fYSize = rGeometry.m_aSize.DirectionY; + + fXPos -= fXSize/2.0; + fYPos -= fYSize/2.0; + + //set properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + /* + Matrix3D aTransformationFromUnitCircle; + aTransformationFromUnitCircle.Rotate(fStartAngleDegree*F_PI/180.0); + aTransformationFromUnitCircle.ScaleX(fInnerXRadius+fXWidthRadius); + aTransformationFromUnitCircle.ScaleY(fInnerXRadius+fXWidthRadius); + aTransformationFromUnitCircle.TranslateX(rGeometry.m_aPosition.PositionX); + aTransformationFromUnitCircle.TranslateY(rGeometry.m_aPosition.PositionY); + drawing::PolyPolygonBezierCoords aCoords = getCircularArcBezierCoords( fWidthAngleDegree * F_PI/180.0 + , aTransformationFromUnitCircle ); + */ + + drawing::PolyPolygonBezierCoords aCoords = getRingBezierCoords( + fInnerXRadius, fOuterXRadius, fOuterYRadius + , fWidthAngleDegree*F_PI/180.0, fStartAngleDegree*F_PI/180.0 + , rGeometry.m_aPosition.PositionX, rGeometry.m_aPosition.PositionY); + xProp->setPropertyValue( C2U( "PolyPolygonBezier" ) + , uno::makeAny( aCoords ) ); + + /* + Rectangle aRect(fXPos,fYPos+fYSize,fXPos+fXSize,fYPos); + XPolygon aXPolygon = ImpCalcXPoly(aRect + , fStartAngleDegree*100.0 + , (fStartAngleDegree+fWidthAngleDegree)*100.0); + + sal_Int32 nCount = aXPolygon.GetSize(); + if( nCount > 0 ) + { + */ + /* + drawing::PointSequence aSeq( nCount ); + awt::Point* pSequence = aSeq.getArray(); + + for(sal_Int32 b=0;b<nCount;b++) + { + *pSequence = awt::Point( aXPolygon[b].X(), aXPolygon[b].Y() ); + pSequence++; + } + */ + /* + + drawing::PointSequence aSeq( 4 ); + awt::Point* pSequence = aSeq.getArray(); + pSequence[0] = awt::Point( 0, 0 ); + pSequence[1] = awt::Point( 10000, -10000 ); + pSequence[2] = awt::Point( 10000, 0 ); + pSequence[3] = awt::Point( 0, 0 ); + + + //UNO_NAME_POLYGON drawing::PointSequence* + xProp->setPropertyValue( C2U( UNO_NAME_POLYGON ) + , uno::makeAny( aSeq ) ); + } + */ + +/* +UNO_NAME_POLYGONKIND "PolygonKind" drawing::PolygonKind* (readonly) + +UNO_NAME_POLYPOLYGON "PolyPolygon" drawing::PointSequenceSequence* +UNO_NAME_POLYGON "Polygon" drawing::PointSequence* + +UNO_NAME_POLYPOLYGONBEZIER "PolyPolygonBezier" drawing::PolyPolygonBezierCoords* +*/ + + /* + //UNO_NAME_CIRCKIND drawing::CircleKind + xProp->setPropertyValue( C2U( UNO_NAME_CIRCKIND ) + , uno::makeAny(drawing::CircleKind_SECTION) ); + + double factor = 100.0; + + //UNO_NAME_CIRCSTARTANGLE sal_Int32 + xProp->setPropertyValue( C2U( UNO_NAME_CIRCSTARTANGLE ) + , uno::makeAny((sal_Int32)(fStartAngleDegree*factor)) ); + + //UNO_NAME_CIRCENDANGLE sal_Int32 + xProp->setPropertyValue( C2U( UNO_NAME_CIRCENDANGLE ) + , uno::makeAny((sal_Int32)((fStartAngleDegree+fWidthAngleDegree)*factor)) ); + */ + +// ShapeFactory::setShapeAppearance( rAppearance, xProp, sal_False ); + } + catch( uno::Exception& e ) + { + e; + } + } + +// xShape->setPosition(awt::Point(rGeometry.m_aPosition.PositionX,rGeometry.m_aPosition.PositionY)); + +// xShape->setPosition(awt::Point(fXPos,fYPos)); +// xShape->setSize(awt::Size(fXSize,fYSize)); + + /* + xShape->setPosition(awt::Point(100,100)); + xShape->setSize(awt::Size(10000,10000)); + */ + + /* + //create shape + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( + //C2U("com.sun.star.drawing.EllipseShape") ), uno::UNO_QUERY ); + C2U("com.sun.star.drawing.Shape3DExtrudeObject") ), uno::UNO_QUERY ); + + xTarget->add(xShape); + + //set properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + //UNO_NAME_CIRCKIND drawing::CircleKind + xProp->setPropertyValue( C2U( UNO_NAME_CIRCKIND ) + , uno::makeAny(drawing::CircleKind_SECTION) ); + + double factor = 100.0; + + //UNO_NAME_CIRCSTARTANGLE sal_Int32 + xProp->setPropertyValue( C2U( UNO_NAME_CIRCSTARTANGLE ) + , uno::makeAny((sal_Int32)(fStartAngleDegree*factor)) ); + + //UNO_NAME_CIRCENDANGLE sal_Int32 + xProp->setPropertyValue( C2U( UNO_NAME_CIRCENDANGLE ) + , uno::makeAny((sal_Int32)((fStartAngleDegree+fWidthAngleDegree)*factor)) ); + + ShapeFactory::setShapeAppearance( rAppearance, xProp ); + } + catch( uno::Exception& e ) + { + e; + } + } + //need left upper corner not the middle of the circle (!! x and y are assumed to scale in the same way here) + double fXPos = rGeometry.m_aPosition.PositionX; + double fYPos = rGeometry.m_aPosition.PositionY; + + double fXSize = rGeometry.m_aSize.DirectionX; + double fYSize = rGeometry.m_aSize.DirectionY; + + fXPos -= fXSize/2.0; + fYPos -= fYSize/2.0; + + xShape->setPosition(awt::Point(fXPos,fYPos)); + xShape->setSize(awt::Size(fXSize,fYSize)); + */ + return xShape; +} + +uno::Reference< drawing::XShape > + ShapeFactory::createPieSegment( + const uno::Reference< drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry ) +// , const ShapeAppearance& rAppearance ) +{ + double fInnerXRadius = rGeometry.m_aSize2.DirectionX/2.0; + double fXWidthRadius = rGeometry.m_aSize.DirectionX/2.0 - fInnerXRadius; + + double fDepth = rGeometry.m_aSize.DirectionZ; + + double fStartAngleDegree = rGeometry.m_aSize2.DirectionY; + double fWidthAngleDegree = rGeometry.m_aSize2.DirectionZ; + + DBG_ASSERT(fDepth>0, "The height of a pie needs to be > 0"); + DBG_ASSERT(fXWidthRadius>0, "The radius of a pie needs to be > 0"); + DBG_ASSERT(fInnerXRadius>=0, "The inner radius of a pie needs to be > 0"); + DBG_ASSERT(fWidthAngleDegree>0, "The angle of a pie needs to be > 0"); + DBG_ASSERT(fWidthAngleDegree<=360, "The angle of a pie needs to be <= 360 degree"); + + while(fWidthAngleDegree>360) + fWidthAngleDegree -= 360.0; + while(fWidthAngleDegree<0) + fWidthAngleDegree += 360.0; + + //create shape + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( + C2U("com.sun.star.drawing.Shape3DLatheObject") ), uno::UNO_QUERY ); + + xTarget->add(xShape); + + //set properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + //PercentDiagonal + xProp->setPropertyValue( C2U( UNO_NAME_3D_PERCENT_DIAGONAL ) + , uno::makeAny((sal_Int16)0) ); + + //Polygon + xProp->setPropertyValue( C2U( UNO_NAME_3D_POLYPOLYGON3D ) + , createPolyPolygon_PieSegment( fDepth, fXWidthRadius, fInnerXRadius ) ); + + //UNO_NAME_3D_LATHE_END_ANGLE sal_Int16 + xProp->setPropertyValue( C2U( UNO_NAME_3D_LATHE_END_ANGLE ) + , uno::makeAny((sal_Int16)(fWidthAngleDegree*10.0)) ); + + //Matrix for position + { + Matrix4D aM4; + aM4.ScaleZ(rGeometry.m_aSize.DirectionY/rGeometry.m_aSize.DirectionX); + aM4.RotateY( ZDIRECTION*fStartAngleDegree*F_PI/180.0 ); + aM4.Translate(rGeometry.m_aPosition.PositionX, rGeometry.m_aPosition.PositionZ, rGeometry.m_aPosition.PositionY); + drawing::HomogenMatrix aHM = Matrix4DToHomogenMatrix(aM4); + xProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX ) + , uno::makeAny(aHM) ); + } + + //Segments + xProp->setPropertyValue( C2U( UNO_NAME_3D_VERT_SEGS ) + , uno::makeAny(CHART_3DOBJECT_SEGMENTCOUNT) ); + xProp->setPropertyValue( C2U( UNO_NAME_3D_HORZ_SEGS ) + , uno::makeAny(CHART_3DOBJECT_SEGMENTCOUNT) ); + +// ShapeFactory::setShapeAppearance( rAppearance, xProp ); + } + catch( uno::Exception& e ) + { + e; + } + } + return xShape; +} + +uno::Reference< drawing::XShape > + ShapeFactory::createStripe( const uno::Reference< drawing::XShapes >& xTarget + , const Stripe& rStripe + , const ShapeAppearance& rAppearance + , sal_Bool bDoubleSided ) +{ + //create shape + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.Shape3DPolygonObject" ) ), uno::UNO_QUERY ); + xTarget->add(xShape); + + //set properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + //Polygon + xProp->setPropertyValue( C2U( UNO_NAME_3D_POLYPOLYGON3D ) + , rStripe.getPolyPolygonShape3D() ); + + //Normals Polygon + xProp->setPropertyValue( C2U( UNO_NAME_3D_NORMALSPOLYGON3D ) + , rStripe.getNormalsPolyPolygonShape3D() ); + + //NormalsKind + xProp->setPropertyValue( C2U( UNO_NAME_3D_NORMALS_KIND ) + , uno::makeAny( drawing::NormalsKind_FLAT ) ); + + //LineOnly + xProp->setPropertyValue( C2U( UNO_NAME_3D_LINEONLY ) + , uno::makeAny( (sal_Bool)false) ); + + //DoubleSided + xProp->setPropertyValue( C2U( UNO_NAME_3D_DOUBLE_SIDED ) + , uno::makeAny(bDoubleSided) ); + + ShapeFactory::setShapeAppearance( rAppearance, xProp ); + } + catch( uno::Exception& e ) + { + e; + } + } + return xShape; +} + +uno::Reference< drawing::XShape > + ShapeFactory::createArea3D( const uno::Reference< drawing::XShapes >& xTarget + , const drawing::PolyPolygonShape3D& rPolyPolygon + , double fDepth ) +{ + //create shape + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.Shape3DExtrudeObject") ), uno::UNO_QUERY ); + xTarget->add(xShape); + + //set properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + //depth + xProp->setPropertyValue( C2U( UNO_NAME_3D_EXTRUDE_DEPTH ) + , uno::makeAny((sal_Int32)fDepth) ); + + //PercentDiagonal + sal_Int16 nPercentDiagonal = 0; + xProp->setPropertyValue( C2U( UNO_NAME_3D_PERCENT_DIAGONAL ) + , uno::makeAny( nPercentDiagonal ) ); + + //Polygon + xProp->setPropertyValue( C2U( UNO_NAME_3D_POLYPOLYGON3D ) + , uno::makeAny( rPolyPolygon ) ); + } + catch( uno::Exception& e ) + { + e; + } + } + return xShape; +} + +uno::Reference< drawing::XShape > + ShapeFactory::createArea2D( const uno::Reference< drawing::XShapes >& xTarget + , const drawing::PolyPolygonShape3D& rPolyPolygon ) +{ + //create shape + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.PolyPolygonShape") ), uno::UNO_QUERY ); + xTarget->add(xShape); + + //set properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + //UNO_NAME_POLYGON "Polygon" drawing::PointSequence* + drawing::PointSequenceSequence aPoints( PolyToPointSequence(rPolyPolygon) ); + + //Polygon + xProp->setPropertyValue( C2U( UNO_NAME_POLYPOLYGON ) + , uno::makeAny( aPoints ) ); + + //ZOrder + //an area should always be behind other shapes + xProp->setPropertyValue( C2U( UNO_NAME_MISC_OBJ_ZORDER ) + , uno::makeAny( sal_Int32(0) ) ); + } + catch( uno::Exception& e ) + { + e; + } + } + return xShape; +} + +drawing::PolyPolygonShape3D createPolyPolygon_Symbol( const drawing::Position3D& rPos + , const drawing::Direction3D& rSize + , SymbolType eSymbolType ) +{ + const double& fX = rPos.PositionX; + const double& fY = rPos.PositionY; + + const double fWidthH = rSize.DirectionX/2.0; //fWidthH stands for Half Width + const double fHeightH = rSize.DirectionY/2.0; //fHeightH stands for Half Height + + DBG_ASSERT(eSymbolType!=SYMBOL_NONE, "do not create a symbol with type SYMBOL_NONE"); + if(eSymbolType==SYMBOL_NONE) + eSymbolType=SYMBOL_SQUARE; + + sal_Int32 nPointCount = 4; //all arrow symbols only need 4 points + switch( eSymbolType ) + { + case SYMBOL_SQUARE: + case SYMBOL_DIAMOND: + case SYMBOL_BOWTIE: + case SYMBOL_SANDGLASS: + nPointCount = 5; + break; + default: + break; + } + + //-------------------------------------- + drawing::PolyPolygonShape3D aPP; + + aPP.SequenceX.realloc(1); + aPP.SequenceY.realloc(1); + aPP.SequenceZ.realloc(1); + + drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray(); + drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray(); + drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray(); + + pOuterSequenceX->realloc(nPointCount); + pOuterSequenceY->realloc(nPointCount); + pOuterSequenceZ->realloc(nPointCount); + + double* pInnerSequenceX = pOuterSequenceX->getArray(); + double* pInnerSequenceY = pOuterSequenceY->getArray(); + double* pInnerSequenceZ = pOuterSequenceZ->getArray(); + + for(sal_Int32 nN = nPointCount; nN--;) + *pInnerSequenceZ++ = 0.0; + + switch(eSymbolType) + { + case SYMBOL_ARROW_DOWN: + { + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY+fHeightH; + + *pInnerSequenceX++ = fX+fWidthH; + *pInnerSequenceY++ = fY+fHeightH; + + *pInnerSequenceX++ = fX; + *pInnerSequenceY++ = fY-fHeightH; + + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY+fHeightH; + break; + } + case SYMBOL_ARROW_UP: + { + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + + *pInnerSequenceX++ = fX; + *pInnerSequenceY++ = fY+fHeightH; + + *pInnerSequenceX++ = fX+fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + break; + } + case SYMBOL_ARROW_RIGHT: + { + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY+fHeightH; + + *pInnerSequenceX++ = fX+fWidthH; + *pInnerSequenceY++ = fY; + + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + break; + } + case SYMBOL_ARROW_LEFT: + { + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY; + + *pInnerSequenceX++ = fX+fWidthH; + *pInnerSequenceY++ = fY+fHeightH; + + *pInnerSequenceX++ = fX+fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY; + break; + } + case SYMBOL_BOWTIE: + { + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY+fHeightH; + + *pInnerSequenceX++ = fX+fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + + *pInnerSequenceX++ = fX+fWidthH; + *pInnerSequenceY++ = fY+fHeightH; + + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + break; + } + case SYMBOL_SANDGLASS: + { + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY+fHeightH; + + *pInnerSequenceX++ = fX+fWidthH; + *pInnerSequenceY++ = fY+fHeightH; + + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + + + *pInnerSequenceX++ = fX+fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY+fHeightH; + break; + } + case SYMBOL_DIAMOND: + { + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY; + + *pInnerSequenceX++ = fX; + *pInnerSequenceY++ = fY+fHeightH; + + *pInnerSequenceX++ = fX+fWidthH; + *pInnerSequenceY++ = fY; + + *pInnerSequenceX++ = fX; + *pInnerSequenceY++ = fY-fHeightH; + + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY; + break; + } + default: //case SYMBOL_SQUARE: + { + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY+fHeightH; + + *pInnerSequenceX++ = fX+fWidthH; + *pInnerSequenceY++ = fY+fHeightH; + + *pInnerSequenceX++ = fX+fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + + *pInnerSequenceX++ = fX-fWidthH; + *pInnerSequenceY++ = fY-fHeightH; + break; + } + } + //return uno::Any( &aPP, ::getCppuType((const drawing::PolyPolygonShape3D*)0) ); + return aPP; +} + +uno::Reference< drawing::XShape > + ShapeFactory::createSymbol2D( + const uno::Reference< drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , const ShapeAppearance& rAppearance ) +{ + //create shape + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.PolyPolygonShape") ), uno::UNO_QUERY ); + xTarget->add(xShape); + + //set properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + drawing::PointSequenceSequence aPoints( PolyToPointSequence( + createPolyPolygon_Symbol( rGeometry.m_aPosition + , rGeometry.m_aSize + , rAppearance.m_eSymbolType ) )); + + //Polygon + xProp->setPropertyValue( C2U( UNO_NAME_POLYPOLYGON ) + , uno::makeAny( aPoints ) ); + + ShapeFactory::setShapeAppearance( rAppearance, xProp, sal_False ); + } + catch( uno::Exception& e ) + { + e; + } + } + return xShape; +} + +uno::Reference< drawing::XShape > + ShapeFactory::createSymbol3D( const uno::Reference< drawing::XShapes >& xTarget + , const DataPointGeometry& rGeometry + , const ShapeAppearance& rAppearance ) +{ + //create shape + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.Shape3DExtrudeObject") ), uno::UNO_QUERY ); + xTarget->add(xShape); + + //set properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + //depth + xProp->setPropertyValue( C2U( UNO_NAME_3D_EXTRUDE_DEPTH ) + , uno::makeAny((sal_Int32)rGeometry.m_aSize.DirectionZ) ); + + //PercentDiagonal + sal_Int16 nPercentDiagonal = 0; + xProp->setPropertyValue( C2U( UNO_NAME_3D_PERCENT_DIAGONAL ) + , uno::makeAny( nPercentDiagonal ) ); + + //Polygon + xProp->setPropertyValue( C2U( UNO_NAME_3D_POLYPOLYGON3D ) + , uno::makeAny( createPolyPolygon_Symbol( rGeometry.m_aPosition + , rGeometry.m_aSize + , rAppearance.m_eSymbolType ) ) ); + + ShapeFactory::setShapeAppearance( rAppearance, xProp ); + } + catch( uno::Exception& e ) + { + e; + } + } + return xShape; +} + +void setShapeName( uno::Reference< drawing::XShape >& xShape , const ::rtl::OUString& rName ) +{ + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + xProp->setPropertyValue( C2U( UNO_NAME_MISC_OBJ_NAME ) + , uno::makeAny( rName ) ); + } + catch( uno::Exception& e ) + { + e; + } + } +} + +uno::Reference< drawing::XShapes > + ShapeFactory::createGroup2D( const uno::Reference< drawing::XShapes >& xTarget + , ::rtl::OUString aName ) +{ + //create and add to target + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.GroupShape" ) ), uno::UNO_QUERY ); + xTarget->add(xShape); + + //set name + if(aName.getLength()) + setShapeName( xShape , aName ); + + {//workaround + //need this null size as otherwise empty group shapes where painted with a gray border + xShape->setSize(awt::Size(0,0)); + } + + //return + uno::Reference< drawing::XShapes > xShapes = + uno::Reference<drawing::XShapes>( xShape, uno::UNO_QUERY ); + return xShapes; +} + +uno::Reference< drawing::XShapes > + ShapeFactory::createGroup3D( const uno::Reference< drawing::XShapes >& xTarget + , ::rtl::OUString aName ) +{ + //create shape + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.Shape3DSceneObject" ) ), uno::UNO_QUERY ); + + xTarget->add(xShape); + + //it is necessary to set the transform matrix to initialize the scene properly (bug #106316#) + //otherwise all objects which are placed into this Group will not be visible + //the following should be unnecessary after a the bug is fixed + { + //set properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + Matrix4D aM4; + xProp->setPropertyValue( C2U( UNO_NAME_3D_TRANSFORM_MATRIX ) + , uno::makeAny(Matrix4DToHomogenMatrix(aM4)) ); + } + catch( uno::Exception& e ) + { + e; + } + } + } + + //set name + if(aName.getLength()) + setShapeName( xShape , aName ); + + //return + uno::Reference< drawing::XShapes > xShapes = + uno::Reference<drawing::XShapes>( xShape, uno::UNO_QUERY ); + return xShapes; +} + +uno::Reference< drawing::XShape > + ShapeFactory::createLine3D( const uno::Reference< drawing::XShapes >& xTarget + , const drawing::PolyPolygonShape3D& rPoints + , const LineProperties& rLineProperties ) +{ + if(!rPoints.SequenceX.getLength()) + return NULL; + + //create shape + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.Shape3DPolygonObject") ), uno::UNO_QUERY ); + xTarget->add(xShape); + + //set properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + //Polygon + xProp->setPropertyValue( C2U( UNO_NAME_3D_POLYPOLYGON3D ) + , uno::makeAny( rPoints ) ); + + //LineOnly + xProp->setPropertyValue( C2U( UNO_NAME_3D_LINEONLY ) + , uno::makeAny( (sal_Bool)true ) ); +/* + //Transparency + if(rLineProperties.Transparence.hasValue()) + xProp->setPropertyValue( C2U( UNO_NAME_LINETRANSPARENCE ) + , rLineProperties.Transparence ); + + //LineStyle + if(rLineProperties.LineStyle.hasValue()) + xProp->setPropertyValue( C2U( UNO_NAME_LINESTYLE ) + , rLineProperties.LineStyle ); + + //LineWidth + if(rLineProperties.Width.hasValue()) + xProp->setPropertyValue( C2U( UNO_NAME_LINEWIDTH ) + , rLineProperties.Width ); +*/ + //LineColor + if(rLineProperties.Color.hasValue()) + xProp->setPropertyValue( C2U( UNO_NAME_LINECOLOR ) + , rLineProperties.Color ); + //, uno::makeAny( sal_Int32( Color(COL_RED).GetColor()) ) ); + } + catch( uno::Exception& e ) + { + e; + } + } + return xShape; +} + +uno::Reference< drawing::XShape > + ShapeFactory::createLine2D( const uno::Reference< drawing::XShapes >& xTarget + , const drawing::PointSequenceSequence& rPoints + , const LineProperties& rLineProperties ) +{ + if(!rPoints.getLength()) + return NULL; + + //create shape + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( C2U( + //"com.sun.star.drawing.LineShape") ), uno::UNO_QUERY ); + "com.sun.star.drawing.PolyLineShape") ), uno::UNO_QUERY ); + //"com.sun.star.drawing.PolyLinePathShape") ), uno::UNO_QUERY ); + //"com.sun.star.drawing.PolyPolygonPathShape") ), uno::UNO_QUERY ); + //"com.sun.star.drawing.PolyPolygonShape") ), uno::UNO_QUERY ); + xTarget->add(xShape); + + //set properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet"); + if( xProp.is()) + { + try + { + //Polygon + xProp->setPropertyValue( C2U( UNO_NAME_POLYPOLYGON ) + , uno::makeAny( rPoints ) ); + + //Transparency + if(rLineProperties.Transparence.hasValue()) + xProp->setPropertyValue( C2U( UNO_NAME_LINETRANSPARENCE ) + , rLineProperties.Transparence ); + + //LineStyle + if(rLineProperties.LineStyle.hasValue()) + xProp->setPropertyValue( C2U( UNO_NAME_LINESTYLE ) + , rLineProperties.LineStyle ); + + //LineWidth + if(rLineProperties.Width.hasValue()) + xProp->setPropertyValue( C2U( UNO_NAME_LINEWIDTH ) + , rLineProperties.Width ); + + //LineColor + if(rLineProperties.Color.hasValue()) + xProp->setPropertyValue( C2U( UNO_NAME_LINECOLOR ) + , rLineProperties.Color ); + + //LineDash + if(rLineProperties.Dash.hasValue()) + xProp->setPropertyValue( C2U( UNO_NAME_LINEDASH ) + , rLineProperties.Dash ); + } + catch( uno::Exception& e ) + { + e; + } + } + return xShape; +} + +uno::Any ShapeFactory::makeTransformation( const awt::Point& rScreenPosition2D, double fRotationAnglePi ) +{ + Matrix3D aM3; + //As autogrow is active the rectangle is automatically expanded to that side + //to which the text is not adjusted. + aM3.Scale( 1, 1 ); + aM3.Rotate( fRotationAnglePi ); + aM3.Translate( rScreenPosition2D.X, rScreenPosition2D.Y ); + uno::Any aATransformation = uno::makeAny( Matrix3DToHomogenMatrix3(aM3) ); + return aATransformation; +} + +uno::Reference< drawing::XShape > + ShapeFactory::createText( const uno::Reference< drawing::XShapes >& xTarget + , const ::rtl::OUString& rText + , const tNameSequence& rPropNames + , const tAnySequence& rPropValues + , const uno::Any& rATransformation ) +{ + //create shape and add to page + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.TextShape" ) ), uno::UNO_QUERY ); + xTarget->add(xShape); + + //set text + uno::Reference< text::XTextRange > xTextRange( xShape, uno::UNO_QUERY ); + if( xTextRange.is() ) + xTextRange->setString( rText ); + + //set properties + PropertyMapper::setMultiProperties( rPropNames, rPropValues, xShape ); + + //set position matrix + //the matrix needs to be set at the end behind autogrow and such position influencing properties + uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY ); + if( xProp.is() ) + { + try + { + xProp->setPropertyValue( C2U( "Transformation" ), rATransformation ); + } + catch( uno::Exception& e ) + { + e; + } + } + return xShape; + /* + //create 3D anchor shape + uno::Reference< drawing::XShape > xShape3DAnchor = createCube( xTarget3D + , DataPointGeometry( rGeometry.m_aPosition,drawing::Direction3D(1000,1000,1000) ) + , ShapeAppearance( Color(COL_YELLOW).GetColor() ) ); + //get 2D position from xShape3DAnchor + //the 2D position of the 3D Shape is not correct initially this is a bug in draw @todo + //awt::Point aPosition2D( xShape3DAnchor->getPosition() ); + */ + + //-- + /* + uno::Reference< text::XTextRange > xTextRange( xShape2DText, uno::UNO_QUERY ); + uno::Reference< text::XText > xText11( xShape2DText, uno::UNO_QUERY ); + if( xTextRange.is() ) + { + uno::Reference< text::XText > xText = xTextRange->getText(); + + xText->insertString( xTextRange, C2U( "Hello" ), true ); + xText->insertControlCharacter( xTextRange, + text::ControlCharacter::LINE_BREAK, false ); + xText->insertString( xTextRange, C2U( "World" ), false ); + + rtl::OUString aTmp = xText->getString(); + int a=1; + } + */ + + //-- + /* + //get the created paragraph and set the character properties there + uno::Reference< container::XEnumerationAccess > xEnumerationAccess( xShape, uno::UNO_QUERY ); + uno::Reference< container::XEnumeration > xEnumeration = xEnumerationAccess->createEnumeration(); + uno::Any aAParagraph = xEnumeration->nextElement(); + uno::Reference< text::XTextContent > xTextContent = NULL; + aAParagraph >>= xTextContent; + uno::Reference< beans::XPropertySet > xParaProp( xTextContent, uno::UNO_QUERY ); + if(xParaProp.is()) + { + try + { + //test: + //ControlTextEmphasis + //FontEmphasisMark + //CharEmphasis + xParaProp->setPropertyValue( C2U( "CharEmphasize" ), + uno::makeAny( text::FontEmphasis::DOT_ABOVE ) ); + + xParaProp->setPropertyValue( C2U( "FontEmphasisMark" ), + uno::makeAny( sal_Int16(2) ) ); + + xParaProp->setPropertyValue( C2U( "ControlTextEmphasis" ), + uno::makeAny( sal_Int16(2) ) ); + } + catch( uno::Exception& e ) + { + e; + } + } + */ +} + +//static +rtl::OUString ShapeFactory::getStackedString( const rtl::OUString& rString, bool bStacked ) +{ + sal_Int32 nLen = rString.getLength(); + if(!bStacked || !nLen) + return rString; + + rtl::OUStringBuffer aStackStr; + rtl::OUStringBuffer aSource(rString); + + //add a newline after each letter + //as we do not no letters here add a newline after each char + for( sal_Int32 nPosSrc=0; nPosSrc < nLen; nPosSrc++ ) + { + aStackStr.append( aSource.charAt( nPosSrc ) ); + aStackStr.append( sal_Unicode('\r') ); + } + return aStackStr.makeStringAndClear(); +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/main/Stripe.cxx b/chart2/source/view/main/Stripe.cxx new file mode 100644 index 000000000000..6a090558a196 --- /dev/null +++ b/chart2/source/view/main/Stripe.cxx @@ -0,0 +1,197 @@ +/************************************************************************* + * + * $RCSfile: Stripe.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "Stripe.hxx" + +#ifndef __CHART_COMMON_CONVERTERS_HXX +#include "CommonConverters.hxx" +#endif + +#ifndef _COM_SUN_STAR_DRAWING_POLYPOLYGONSHAPE3D_HPP_ +#include <com/sun/star/drawing/PolyPolygonShape3D.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_DOUBLESEQUENCE_HPP_ +#include <com/sun/star/drawing/DoubleSequence.hpp> +#endif + +#ifndef _POLY3D_HXX +#include <svx/poly3d.hxx> +#endif + +using namespace ::com::sun::star; + +//............................................................................. +namespace chart +{ +//............................................................................. + +Stripe::Stripe( const drawing::Position3D& rPoint1 + , const drawing::Direction3D& rDirectionToPoint2 + , const drawing::Direction3D& rDirectionToPoint4 ) + : m_aPoint1(rPoint1) + , m_aPoint2(rPoint1+rDirectionToPoint2) + , m_aPoint3(m_aPoint2+rDirectionToPoint4) + , m_aPoint4(rPoint1+rDirectionToPoint4) +{ + +} + +drawing::Direction3D Stripe::GetDirectionTo4() const +{ + return m_aPoint4-m_aPoint1; +} + +/* +Stripe::Stripe( const drawing::Position3D& rPoint1 + , const drawing::Position3D& rPoint2 + , const drawing::Position3D& rPoint3 + , const drawing::Position3D& rPoint4 ) + : m_aPoint1(rPoint1) + , m_aPoint2(rPoint2) + , m_aPoint3(rPoint3) + , m_aPoint4(rPoint4) +{ + +} +*/ + +uno::Any Stripe::getPolyPolygonShape3D() const +{ + drawing::PolyPolygonShape3D aPP; + + aPP.SequenceX.realloc(1); + aPP.SequenceY.realloc(1); + aPP.SequenceZ.realloc(1); + + drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray(); + drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray(); + drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray(); + + pOuterSequenceX->realloc(4); + pOuterSequenceY->realloc(4); + pOuterSequenceZ->realloc(4); + + double* pInnerSequenceX = pOuterSequenceX->getArray(); + double* pInnerSequenceY = pOuterSequenceY->getArray(); + double* pInnerSequenceZ = pOuterSequenceZ->getArray(); + + *pInnerSequenceX++ = m_aPoint1.PositionX; + *pInnerSequenceY++ = m_aPoint1.PositionY; + *pInnerSequenceZ++ = m_aPoint1.PositionZ; + + *pInnerSequenceX++ = m_aPoint2.PositionX; + *pInnerSequenceY++ = m_aPoint2.PositionY; + *pInnerSequenceZ++ = m_aPoint2.PositionZ; + + *pInnerSequenceX++ = m_aPoint3.PositionX; + *pInnerSequenceY++ = m_aPoint3.PositionY; + *pInnerSequenceZ++ = m_aPoint3.PositionZ; + + *pInnerSequenceX++ = m_aPoint4.PositionX; + *pInnerSequenceY++ = m_aPoint4.PositionY; + *pInnerSequenceZ++ = m_aPoint4.PositionZ; + + return uno::Any( &aPP, ::getCppuType((const drawing::PolyPolygonShape3D*)0) ); +} + +drawing::Direction3D Stripe::getNormal() const +{ + Polygon3D aPolygon3D(3); + aPolygon3D[0] = Position3DToVector3D( m_aPoint1 ); + aPolygon3D[1] = Position3DToVector3D( m_aPoint2 ); + aPolygon3D[2] = Position3DToVector3D( m_aPoint3 ); + Vector3D aNormal = aPolygon3D.GetNormal(); + return Vector3DToDirection3D(aNormal); +} + +uno::Any Stripe::getNormalsPolyPolygonShape3D() const +{ + drawing::PolyPolygonShape3D aPP; + + aPP.SequenceX.realloc(1); + aPP.SequenceY.realloc(1); + aPP.SequenceZ.realloc(1); + + drawing::DoubleSequence* pOuterSequenceX = aPP.SequenceX.getArray(); + drawing::DoubleSequence* pOuterSequenceY = aPP.SequenceY.getArray(); + drawing::DoubleSequence* pOuterSequenceZ = aPP.SequenceZ.getArray(); + + pOuterSequenceX->realloc(4); + pOuterSequenceY->realloc(4); + pOuterSequenceZ->realloc(4); + + double* pInnerSequenceX = pOuterSequenceX->getArray(); + double* pInnerSequenceY = pOuterSequenceY->getArray(); + double* pInnerSequenceZ = pOuterSequenceZ->getArray(); + + drawing::Direction3D aNormal( getNormal() ); + + for(sal_Int32 nN=4; --nN; ) + { + *pInnerSequenceX++ = aNormal.DirectionX; + *pInnerSequenceY++ = aNormal.DirectionY; + *pInnerSequenceZ++ = aNormal.DirectionZ; + } + return uno::Any( &aPP, ::getCppuType((const drawing::PolyPolygonShape3D*)0) ); +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx new file mode 100644 index 000000000000..e4fa638209f2 --- /dev/null +++ b/chart2/source/view/main/VDataSeries.cxx @@ -0,0 +1,500 @@ +/************************************************************************* + * + * $RCSfile: VDataSeries.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "VDataSeries.hxx" +#include "chartview/ObjectIdentifier.hxx" +#include "macros.hxx" + +//#include "CommonConverters.hxx" + +#ifndef INCLUDED_RTL_MATH_HXX +#include <rtl/math.hxx> +#endif + +#ifndef _TOOLS_DEBUG_HXX +#include <tools/debug.hxx> +#endif + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XNUMERICALDATASEQUENCE_HPP_ +#include <drafts/com/sun/star/chart2/XNumericalDataSequence.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_LINESTYLE_HPP_ +#include <com/sun/star/drawing/LineStyle.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_TEXTVERTICALADJUST_HPP_ +#include <com/sun/star/drawing/TextVerticalAdjust.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_TEXTHORIZONTALADJUST_HPP_ +#include <com/sun/star/drawing/TextHorizontalAdjust.hpp> +#endif +#ifndef _COM_SUN_STAR_TEXT_WRITINGMODE_HPP_ +#include <com/sun/star/text/WritingMode.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; +/* +void PlottingPositionHelper::setTransformationSceneToScreen( const drawing::HomogenMatrix& rMatrix) +{ + m_aMatrixScreenToScene = HomogenMatrixToMatrix4D(rMatrix); +} + +void PlottingPositionHelper::setScales( const uno::Sequence< ExplicitScaleData >& rScales ) +{ + m_aScales = rScales; +} +*/ +VDataSeries::VDataSeries() + : m_xShape(NULL) + , m_xLabelsShape(NULL) + , m_aAppearanceOfSeries(12632256) //LIGHT_GRAY is default color for dataseries for testing + , m_xDataSeries(NULL) + , m_aDataSequences() + , m_nPointCount(0) + , m_xData_XValues(NULL) + , m_xData_YValues(NULL) + , m_xData_ZValues(NULL) + + , m_apCaption_Series(NULL) + , m_apLabelPropNames_Series(NULL) + , m_apLabelPropValues_Series(NULL) + , m_apCaption_AttributedPoint(NULL) + , m_apLabelPropNames_AttributedPoint(NULL) + , m_apLabelPropValues_AttributedPoint(NULL) +{ + +} + +void initDoubleValues( uno::Sequence< double >& rDoubleValues, + const uno::Reference< XDataSequence >& xDataSequence ) +{ + OSL_ASSERT( xDataSequence.is()); + if(!xDataSequence.is()) + return; + + uno::Reference< XNumericalDataSequence > xNumericalDataSequence + = uno::Reference< XNumericalDataSequence >( xDataSequence, uno::UNO_QUERY ); + if( xNumericalDataSequence.is() ) + { + rDoubleValues = xNumericalDataSequence->getNumericalData(); + } + else + { + uno::Sequence< uno::Any > aValues = xDataSequence->getData(); + rDoubleValues.realloc(aValues.getLength()); + for(sal_Int32 nN=aValues.getLength();nN--;) + { + if( !(aValues[nN] >>= rDoubleValues[nN]) ) + { + ::rtl::math::setNan( &rDoubleValues[nN] ); + } + } + } +} + +VDataSeries::VDataSeries( uno::Reference< XDataSeries > xDataSeries, const ShapeAppearance& rDefaultAppearence ) + : m_xShape(NULL) + , m_xLabelsShape(NULL) + , m_aAppearanceOfSeries(rDefaultAppearence) //LIGHT_GRAY is default color for dataseries for testing + , m_xDataSeries(xDataSeries) + , m_aDataSequences() + , m_nPointCount(0) + , m_xData_XValues(NULL) + , m_xData_YValues(NULL) + , m_xData_ZValues(NULL) + + , m_apCaption_Series(NULL) + , m_apLabelPropNames_Series(NULL) + , m_apLabelPropValues_Series(NULL) + , m_apCaption_AttributedPoint(NULL) + , m_apLabelPropNames_AttributedPoint(NULL) + , m_apLabelPropValues_AttributedPoint(NULL) +{ + uno::Reference<XDataSource> xDataSource = + uno::Reference<XDataSource>( xDataSeries, uno::UNO_QUERY ); + + m_aDataSequences = xDataSource->getDataSequences(); + + for(sal_Int32 nN = m_aDataSequences.getLength();nN--;) + { + uno::Reference<XDataSequence> xDataSequence = m_aDataSequences[nN]; + uno::Reference<beans::XPropertySet> xProp(xDataSequence, uno::UNO_QUERY ); + if( xProp.is()) + { + try + { + uno::Any aARole = xProp->getPropertyValue( C2U( "Role" ) ); + rtl::OUString aRole; + aARole >>= aRole; + + if( aRole.equals(C2U("x-values")) ) + { + m_xData_XValues = xDataSequence; + } + else if( aRole.equals(C2U("values")) ) + { + m_xData_YValues = xDataSequence; + initDoubleValues( m_YValues_Double, m_xData_YValues ); + m_nPointCount = xDataSequence->getData().getLength(); //@todo determination of m_nPointCount may needs to be improved (e.g. max of x,y,z or something) + } + //@todo assign the other roles (+ error for unknown?) + } + catch( uno::Exception& e ) + { + e; + } + } + } + + + uno::Reference<beans::XPropertySet> xProp(xDataSeries, uno::UNO_QUERY ); + if( xProp.is()) + { + try + { + //get style + uno::Any aAFirstColor = xProp->getPropertyValue( C2U( "Color" ) ); + sal_Int32 nFirstColor; + if(aAFirstColor>>=nFirstColor) + m_aAppearanceOfSeries.m_nColorData = nFirstColor; + + //get CID + uno::Any aAIdentifier = xProp->getPropertyValue( C2U( "Identifier" ) ); + aAIdentifier >>= m_aIdentifier; + + m_aCID = ObjectIdentifier::createClassifiedIdentifier( + OBJECTTYPE_DATA_SERIES, m_aIdentifier ); + m_aPointCID_Stub = ObjectIdentifier::createPointCID_Stub( m_aCID ); + + m_aLabelCID_Stub = ObjectIdentifier::createClassifiedIdentifier( + OBJECTTYPE_DATA_LABEL, ::rtl::OUString(), getLabelsCID() ); + + //get AttributedDataPoints + xProp->getPropertyValue( C2U( "AttributedDataPoints" ) ) >>= m_aAttributedDataPointIndexList; + } + catch( uno::Exception& e ) + { + e; + } + } +} + +VDataSeries::~VDataSeries() +{ +} + +rtl::OUString VDataSeries::getCID() const +{ + return m_aCID; +} +rtl::OUString VDataSeries::getPointCID_Stub() const +{ + return m_aPointCID_Stub; +} +rtl::OUString VDataSeries::getLabelsCID() const +{ + return ObjectIdentifier::createClassifiedIdentifier( + OBJECTTYPE_DATA_LABELS, m_aIdentifier ); +} +rtl::OUString VDataSeries::getLabelCID_Stub() const +{ + return m_aLabelCID_Stub; +} + +sal_Int32 VDataSeries::getTotalPointCount() const +{ + return m_nPointCount; +} + +double VDataSeries::getX( sal_Int32 index ) const +{ + if(m_xData_XValues.is()) + { + return 1; //@todo + } + else + { + return index; + } +} + +double VDataSeries::getY( sal_Int32 index ) const +{ + if( 0<=index && index<m_YValues_Double.getLength() ) + return m_YValues_Double[index]; + else + { + double fNan; + ::rtl::math::setNan( & fNan ); + return fNan; + } +} + +rtl::OUString VDataSeries::getCategoryString( sal_Int32 index ) const +{ + //@todo get real Category string if any - else return empty string + rtl::OUString aRet; + if( 0<=index && index<m_nPointCount ) + { + aRet+=C2U("index "); + aRet+=rtl::OUString::valueOf(index); + } + return aRet; +} + +ShapeAppearance VDataSeries::getAppearanceOfPoint( sal_Int32 index ) const +{ + return m_aAppearanceOfSeries; +} + +bool VDataSeries::isAttributedDataPoint( sal_Int32 index ) const +{ + //returns true if the data point assigned by the given index has set it's own properties + if( index>=m_nPointCount || m_nPointCount==0) + return false; + for(sal_Int32 nN=m_aAttributedDataPointIndexList.getLength();nN--;) + { + if(index==m_aAttributedDataPointIndexList[nN]) + return true; + } + return false; +} + +uno::Reference< beans::XPropertySet > VDataSeries::getPropertiesOfPoint( sal_Int32 index ) const +{ + if( isAttributedDataPoint( index ) ) + return m_xDataSeries->getDataPointByIndex(index); + return this->getPropertiesOfSeries(); +} + +uno::Reference< beans::XPropertySet > VDataSeries::getPropertiesOfSeries() const +{ + return uno::Reference<beans::XPropertySet>(m_xDataSeries, uno::UNO_QUERY ); +} + +::std::auto_ptr< DataCaptionStyle > getDataCaptionStyleFromPropertySet( + const uno::Reference< beans::XPropertySet >& xProp ) +{ + ::std::auto_ptr< DataCaptionStyle > apCaption( new DataCaptionStyle() ); + try + { + if( !(xProp->getPropertyValue( C2U( "DataCaption" ) ) >>= *apCaption) ) + apCaption.reset(); + } + catch( uno::Exception &e) + { + e; + } + return apCaption; +} + +DataCaptionStyle* VDataSeries::getDataCaptionStyle( sal_Int32 index ) const +{ + DataCaptionStyle* pRet = NULL; + if( isAttributedDataPoint( index ) ) + { + if(!m_apCaption_AttributedPoint.get() || m_nCurrentAttributedPoint!=index) + { + m_apCaption_AttributedPoint = getDataCaptionStyleFromPropertySet( this->getPropertiesOfPoint( index ) ); + m_nCurrentAttributedPoint = index; + } + pRet = m_apCaption_AttributedPoint.get(); + } + else + { + if(!m_apCaption_Series.get()) + m_apCaption_Series = getDataCaptionStyleFromPropertySet( this->getPropertiesOfPoint( index ) ); + pRet = m_apCaption_Series.get(); + } + return pRet; +} + + +void createTextLabelMultiPropertyListsFromPropertySet( + const uno::Reference< beans::XPropertySet >& xSourceProp + , ::std::auto_ptr< tNameSequence >& rLabelPropNames + , ::std::auto_ptr< tAnySequence >& rLabelPropValues + ) +{ + tPropertyNameValueMap aValueMap; + + //fill character properties into the ValueMap + PropertyMapper::getValueMap( aValueMap + , PropertyMapper::getPropertyNameMapForCharacterProperties() + , uno::Reference< beans::XPropertySet >::query( xSourceProp ) //Text Properties source + ); + + //------------------------- + //some more shape properties apart from character properties, position-matrix and label string + + //@todo get correct horizontal and vertical adjust and writing mode + drawing::TextHorizontalAdjust eHorizontalAdjust = drawing::TextHorizontalAdjust_CENTER; + drawing::TextVerticalAdjust eVerticalAdjust = drawing::TextVerticalAdjust_CENTER; + //text::WritingMode eWritingMode = text::WritingMode_LR_TB;//@todo get correct one + + aValueMap.insert( tPropertyNameValueMap::value_type( C2U("LineStyle"), uno::makeAny(drawing::LineStyle_NONE) ) ); // drawing::LineStyle + aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextHorizontalAdjust"), uno::makeAny(eHorizontalAdjust) ) ); // drawing::TextHorizontalAdjust + aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextVerticalAdjust"), uno::makeAny(eVerticalAdjust) ) ); //drawing::TextVerticalAdjust + //aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextWritingMode"), uno::makeAny(eWritingMode) ) ); //text::WritingMode + aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextAutoGrowHeight"), uno::makeAny(sal_True) ) ); // sal_Bool + aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextAutoGrowWidth"), uno::makeAny(sal_True) ) ); // sal_Bool + aValueMap.insert( tPropertyNameValueMap::value_type( C2U("Name"), uno::makeAny( rtl::OUString() ) ) ); //CID rtl::OUString - needs to be overwritten for each point + + //------------------------- + tNameSequence* pPropNames = new tNameSequence(); + tAnySequence* pPropValues = new tAnySequence(); + PropertyMapper::getMultiPropertyListsFromValueMap( *pPropNames, *pPropValues, aValueMap ); + + rLabelPropNames = ::std::auto_ptr< tNameSequence >(pPropNames); + rLabelPropValues = ::std::auto_ptr< tAnySequence >(pPropValues); +} + +bool VDataSeries::getTextLabelMultiPropertyLists( sal_Int32 index + , tNameSequence*& pPropNames + , tAnySequence*& pPropValues ) const +{ + pPropNames = NULL; pPropValues = NULL; + if( isAttributedDataPoint( index ) ) + { + if(!m_apLabelPropValues_AttributedPoint.get() || m_nCurrentAttributedPoint!=index) + { + createTextLabelMultiPropertyListsFromPropertySet( + this->getPropertiesOfPoint( index ) + , m_apLabelPropNames_AttributedPoint + , m_apLabelPropValues_AttributedPoint ); + m_nCurrentAttributedPoint = index; + } + pPropNames = m_apLabelPropNames_AttributedPoint.get(); + pPropValues = m_apLabelPropValues_AttributedPoint.get(); + } + else + { + if(!m_apLabelPropValues_Series.get()) + { + createTextLabelMultiPropertyListsFromPropertySet( + this->getPropertiesOfPoint( index ) + , m_apLabelPropNames_Series + , m_apLabelPropValues_Series ); + } + pPropNames = m_apLabelPropNames_Series.get(); + pPropValues = m_apLabelPropValues_Series.get(); + } + if(pPropNames&&pPropValues) + return true; + return false; +} + +//----------------------------------------------------------------------------- + +/* +//static +sal_Int32 VDataSeries::getCategoryCount( + const uno::Sequence< uno::Reference< XDataSeries > >& rSeriesList ) +{ + sal_Int32 nRet = 1; + for( sal_Int32 nN = rSeriesList.getLength(); nN--; ) + { + uno::Reference<XDataSource> xDataSource = + uno::Reference<XDataSource>( rSeriesList[nN], uno::UNO_QUERY ); + + uno::Sequence< uno::Reference< XDataSequence > > aDataSequences + = xDataSource->getDataSequences(); + + for(sal_Int32 nN = aDataSequences.getLength();nN--;) + { + uno::Reference<XDataSequence> xDataSequence = aDataSequences[nN]; + uno::Reference<beans::XPropertySet> xProp(xDataSequence, uno::UNO_QUERY ); + if( xProp.is()) + { + try + { + uno::Any aARole = xProp->getPropertyValue( C2U( "Role" ) ); + rtl::OUString aRole; + aARole >>= aRole; + + if( aRole.equals(C2U("categories")) ) + { + sal_Int32 nCount = xDataSequence->getData().getLength(); + if(nRet<nCount) + nRet = nCount; + } + } + catch( uno::Exception& e ) + { + e; + } + } + } + + } + return nRet; +} +*/ + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx new file mode 100644 index 000000000000..bf081365dc66 --- /dev/null +++ b/chart2/source/view/main/VLegend.cxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * $RCSfile: VLegend.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _VLEGEND_HXX +#include "VLegend.hxx" +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/main/VLegend.hxx b/chart2/source/view/main/VLegend.hxx new file mode 100644 index 000000000000..f9712b6c67a0 --- /dev/null +++ b/chart2/source/view/main/VLegend.hxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * $RCSfile: VLegend.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _VLEGEND_HXX +#define _VLEGEND_HXX + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +class VLegend +{ +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif + diff --git a/chart2/source/view/main/VTitle.cxx b/chart2/source/view/main/VTitle.cxx new file mode 100644 index 000000000000..a70235e8f555 --- /dev/null +++ b/chart2/source/view/main/VTitle.cxx @@ -0,0 +1,314 @@ +/************************************************************************* + * + * $RCSfile: VTitle.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#include "VTitle.hxx" +#include "CommonConverters.hxx" +#include "macros.hxx" +#include "PropertyMapper.hxx" +#include "ShapeFactory.hxx" +#include "chartview/ObjectIdentifier.hxx" + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XFORMATTEDSTRING_HPP_ +#include <drafts/com/sun/star/chart2/XFormattedString.hpp> +#endif +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XIDENTIFIABLE_HPP_ +#include <drafts/com/sun/star/chart2/XIdentifiable.hpp> +#endif + +// header for class Matrix3D +#ifndef _B2D_MATRIX3D_HXX +#include <goodies/matrix3d.hxx> +#endif + +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_TEXTVERTICALADJUST_HPP_ +#include <com/sun/star/drawing/TextVerticalAdjust.hpp> +#endif +#ifndef _COM_SUN_STAR_DRAWING_TEXTHORIZONTALADJUST_HPP_ +#include <com/sun/star/drawing/TextHorizontalAdjust.hpp> +#endif +#ifndef _COM_SUN_STAR_TEXT_CONTROLCHARACTER_HPP_ +#include <com/sun/star/text/ControlCharacter.hpp> +#endif +#ifndef _COM_SUN_STAR_TEXT_XTEXT_HPP_ +#include <com/sun/star/text/XText.hpp> +#endif +#ifndef _COM_SUN_STAR_TEXT_XTEXTCURSOR_HPP_ +#include <com/sun/star/text/XTextCursor.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. +using namespace ::com::sun::star; +using namespace ::drafts::com::sun::star::chart2; + +VTitle::VTitle( const uno::Reference< XTitle > & xTitle ) + : m_xTarget(NULL) + , m_xShapeFactory(NULL) + , m_xTitle(xTitle) + , m_xShape(NULL) + , m_fRotationAngleDegree(0.0) + , m_nXPos(0) + , m_nYPos(0) +{ +} + +VTitle::~VTitle() +{ +} + +void SAL_CALL VTitle::init( + const uno::Reference< drawing::XShapes >& xTargetPage + , const uno::Reference< lang::XMultiServiceFactory >& xFactory ) +{ + m_xTarget = xTargetPage; + m_xShapeFactory = xFactory; +} + + +awt::Size VTitle::getSize() const +{ + awt::Size aRet; + if(m_xShape.is()) + { + aRet = m_xShape->getSize(); + } + return aRet; +} + +void VTitle::changePosition( const awt::Point& rPos ) +{ + if(!m_xShape.is()) + return; + uno::Reference< beans::XPropertySet > xShapeProp( m_xShape, uno::UNO_QUERY ); + if(!xShapeProp.is()) + return; + try + { + m_nXPos = rPos.X; + m_nYPos = rPos.Y; + + //set position matrix + //the matrix needs to be set at the end behind autogrow and such position influencing properties + Matrix3D aM3; + aM3.Scale( 1, 1 ); + aM3.Rotate( m_fRotationAngleDegree ); + aM3.Translate( m_nXPos, m_nYPos); + xShapeProp->setPropertyValue( C2U( "Transformation" ), uno::makeAny( Matrix3DToHomogenMatrix3(aM3) ) ); + } + catch( uno::Exception& e ) + { + e; + } +} + +void VTitle::createShapes( const awt::Point& rPos ) +{ + try + { + if(!m_xTitle.is()) + return; + + uno::Sequence< uno::Reference< XFormattedString > > aStringList = m_xTitle->getText(); + if(aStringList.getLength()<=0) + return; + + //create shape and add to page + uno::Reference< drawing::XShape > xShape( + m_xShapeFactory->createInstance( C2U( + "com.sun.star.drawing.TextShape" ) ), uno::UNO_QUERY ); + m_xTarget->add(xShape); + m_xShape = xShape; + + //set text and text properties + uno::Reference< text::XText > xText( xShape, uno::UNO_QUERY ); + uno::Reference< text::XTextRange > xTextRange( xShape, uno::UNO_QUERY ); + uno::Reference< text::XTextCursor > xTextCursor( xText->createTextCursor() ); + uno::Reference< beans::XPropertySet > xShapeProp( xShape, uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xTitleProperties( m_xTitle, uno::UNO_QUERY ); + if( !xText.is() || !xTextRange.is() || !xTextCursor.is() || !xShapeProp.is() || !xTitleProperties.is() ) + return; + + tPropertyNameValueMap aValueMap; + //fill line-, fill- and paragraph-properties into the ValueMap + { + tMakePropertyNameMap aNameMap = PropertyMapper::getPropertyNameMapForParagraphProperties(); + const tMakePropertyNameMap& rFillPropMap = PropertyMapper::getPropertyNameMapForFillProperties(); + const tMakePropertyNameMap& rLinePropMap = PropertyMapper::getPropertyNameMapForLineProperties(); + aNameMap.insert(rFillPropMap.begin(),rFillPropMap.end()); + aNameMap.insert(rLinePropMap.begin(),rLinePropMap.end()); + + PropertyMapper::getValueMap( aValueMap, aNameMap, xTitleProperties ); + } + + //fill some more shape properties into the ValueMap + { + drawing::TextHorizontalAdjust eHorizontalAdjust = drawing::TextHorizontalAdjust_CENTER; + drawing::TextVerticalAdjust eVerticalAdjust = drawing::TextVerticalAdjust_CENTER; + //text::WritingMode eWritingMode = text::WritingMode_LR_TB;//@todo get correct one + + aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextHorizontalAdjust"), uno::makeAny(eHorizontalAdjust) ) ); // drawing::TextHorizontalAdjust + aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextVerticalAdjust"), uno::makeAny(eVerticalAdjust) ) ); //drawing::TextVerticalAdjust + //aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextWritingMode"), uno::makeAny(eWritingMode) ) ); //text::WritingMode + aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextAutoGrowHeight"), uno::makeAny(sal_True) ) ); // sal_Bool + aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextAutoGrowWidth"), uno::makeAny(sal_True) ) ); // sal_Bool + + ////aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextMaximumFrameWidth"), uno::makeAny(rSize.Width) ) ); //sal_Int32 + ////aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextMaximumFrameHeight"), uno::makeAny(rSize.Height) ) ); //sal_Int32 + + //set name/classified ObjectID (CID) + uno::Reference< XIdentifiable > xIdent( m_xTitle, uno::UNO_QUERY ); + if( xIdent.is()) + { + rtl::OUString aCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_TITLE, xIdent->getIdentifier() ); + aValueMap.insert( tPropertyNameValueMap::value_type( C2U("Name"), uno::makeAny( aCID ) ) ); //CID rtl::OUString + } + } + + //set global title properties + { + tNameSequence aPropNames; + tAnySequence aPropValues; + PropertyMapper::getMultiPropertyListsFromValueMap( aPropNames, aPropValues, aValueMap ); + PropertyMapper::setMultiProperties( aPropNames, aPropValues, xShape ); + } + + sal_Bool bStackCharacters(sal_False); + try + { + xTitleProperties->getPropertyValue( C2U( "StackCharacters" ) ) >>= bStackCharacters; + } + catch( uno::Exception& e ) + { + e; + } + if(bStackCharacters) + { + //if the characters should be stacked we use only the first character properties for code simplicity + if( aStringList.getLength()>0 ) + { + rtl::OUString aLabel; + for( sal_Int32 nN=0; nN<aStringList.getLength();nN++ ) + aLabel += aStringList[nN]->getString(); + aLabel = ShapeFactory::getStackedString( aLabel, bStackCharacters ); + xTextCursor->gotoEnd(false); + xText->insertString( xTextRange, aLabel, false ); + xTextCursor->gotoEnd(true); + uno::Reference< beans::XPropertySet > xTargetProps( xTextCursor, uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xSourceProps( aStringList[0], uno::UNO_QUERY ); + + PropertyMapper::setMappedProperties( xTargetProps, xSourceProps + , PropertyMapper::getPropertyNameMapForCharacterProperties() ); + } + } + else + { + uno::Sequence< uno::Reference< text::XTextCursor > > aCursorList( aStringList.getLength() ); + for( sal_Int32 nN=0; nN<aStringList.getLength();nN++ ) + { + xTextCursor->gotoEnd(false); + xText->insertString( xTextRange, aStringList[nN]->getString(), false ); + xTextCursor->gotoEnd(true); + aCursorList[nN] = xText->createTextCursorByRange( uno::Reference< text::XTextRange >(xTextCursor,uno::UNO_QUERY) ); + } + for( nN=0; nN<aStringList.getLength();nN++ ) + { + uno::Reference< beans::XPropertySet > xTargetProps( aCursorList[nN], uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xSourceProps( aStringList[nN], uno::UNO_QUERY ); + PropertyMapper::setMappedProperties( xTargetProps, xSourceProps, PropertyMapper::getPropertyNameMapForCharacterProperties() ); + } + } + + double fRotationAngleDegree( 0.0 ); + try + { + xTitleProperties->getPropertyValue( C2U( "TextRotation" ) ) >>= fRotationAngleDegree; + // convert DEG to RAD + fRotationAngleDegree *= ( F_PI / 180.0 ); + } + catch( uno::Exception& e ) + { + e; + } + m_fRotationAngleDegree = fRotationAngleDegree; + m_nXPos = rPos.X; + m_nYPos = rPos.Y; + + //set position matrix + //the matrix needs to be set at the end behind autogrow and such position influencing properties + Matrix3D aM3; + aM3.Scale( 1, 1 ); + aM3.Rotate( m_fRotationAngleDegree ); + aM3.Translate( m_nXPos, m_nYPos ); + xShapeProp->setPropertyValue( C2U( "Transformation" ), uno::makeAny( Matrix3DToHomogenMatrix3(aM3) ) ); + } + catch( uno::Exception& e ) + { + e; + } +} + +//............................................................................. +} //namespace chart +//............................................................................. diff --git a/chart2/source/view/main/VTitle.hxx b/chart2/source/view/main/VTitle.hxx new file mode 100644 index 000000000000..892698abd4c1 --- /dev/null +++ b/chart2/source/view/main/VTitle.hxx @@ -0,0 +1,121 @@ +/************************************************************************* + * + * $RCSfile: VTitle.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (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.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2003 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _CHART2_VTITLE_HXX +#define _CHART2_VTITLE_HXX + +#ifndef _DRAFTS_COM_SUN_STAR_CHART2_XTITLE_HPP_ +#include <drafts/com/sun/star/chart2/XTitle.hpp> +#endif + +#ifndef _COM_SUN_STAR_DRAWING_XSHAPES_HPP_ +#include <com/sun/star/drawing/XShapes.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#endif + +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** +*/ + +class VTitle +{ +public: + VTitle( const ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XTitle > & xTitle ); + virtual ~VTitle(); + + void SAL_CALL init( const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes >& xTargetPage + , const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory); + + //void setSceneMatrix( const ::com::sun::star::drawing::HomogenMatrix& rMatrix ); + + void createShapes( const ::com::sun::star::awt::Point& rPos ); + + ::com::sun::star::awt::Size getSize() const; + void changePosition( const ::com::sun::star::awt::Point& rPos ); + +private: + ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShapes > m_xTarget; + ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory> m_xShapeFactory; + ::com::sun::star::uno::Reference< + ::drafts::com::sun::star::chart2::XTitle > m_xTitle; + ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShape > m_xShape; + + double m_fRotationAngleDegree; + sal_Int32 m_nXPos; + sal_Int32 m_nYPos; +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif + diff --git a/chart2/source/view/main/makefile.mk b/chart2/source/view/main/makefile.mk new file mode 100644 index 000000000000..7e5024ac116a --- /dev/null +++ b/chart2/source/view/main/makefile.mk @@ -0,0 +1,95 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:34 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ= ..$/..$/.. +PRJINC= $(PRJ)$/source +PRJNAME= chart2 +TARGET= chview + +ENABLE_EXCEPTIONS= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: settings.mk + +# --- export library ------------------------------------------------- + +#object files to build and link together to lib $(SLB)$/$(TARGET).lib +SLOFILES = \ + $(SLO)$/NumberFormatterWrapper.obj \ + $(SLO)$/ObjectIdentifier.obj \ + $(SLO)$/PropertyMapper.obj \ + $(SLO)$/Stripe.obj \ + $(SLO)$/DatapointGeometry.obj \ + $(SLO)$/ShapeAppearance.obj \ + $(SLO)$/ShapeFactory.obj \ + $(SLO)$/Linear3DTransformation.obj \ + $(SLO)$/PlottingPositionHelper.obj \ + $(SLO)$/PlotterBase.obj \ + $(SLO)$/VDataSeries.obj \ + $(SLO)$/VLegend.obj \ + $(SLO)$/VTitle.obj \ + $(SLO)$/ChartView.obj + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk diff --git a/chart2/source/view/makefile.mk b/chart2/source/view/makefile.mk new file mode 100644 index 000000000000..89605b2a9ad3 --- /dev/null +++ b/chart2/source/view/makefile.mk @@ -0,0 +1,147 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: bm $ $Date: 2003-10-06 09:58:32 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (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.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ= ..$/.. +PRJNAME= chart2 +TARGET= chartview + +USE_DEFFILE= TRUE +ENABLE_EXCEPTIONS= TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE: $(PRJ)$/util$/makefile.pmk + +# --- export library ------------------------------------------------- + +#You can use several library macros of this form to build libraries that +#do not consist of all object files in a directory or to merge different libraries. +LIB1TARGET= $(SLB)$/$(TARGET).lib + +LIB1FILES= \ + $(SLB)$/chvaxes.lib \ + $(SLB)$/chvtypes.lib \ + $(SLB)$/chvdiagram.lib \ + $(SLB)$/chview.lib + +#-------- + +#Indicates the filename of the shared library. +SHL1TARGET= $(TARGET)$(UPD)$(DLLPOSTFIX) + +#indicates dependencies: +SHL1DEPN= +#Specifies an import library to create. For Win32 only. +SHL1IMPLIB= i$(TARGET) + +#Specifies libraries from the same module to put into the shared library. +#was created above +SHL1LIBS= $(LIB1TARGET) + +#Links import libraries. + +SHL1STDLIBS= $(CHARTTOOLS) \ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(COMPHELPERLIB) \ + $(GOODIESLIB) \ + $(SALLIB) \ + $(SVLIB) \ + $(SVLLIB) \ + $(SVTOOLLIB) \ + $(SVXLIB) \ + $(TKLIB) \ + $(TOOLSLIB) \ + $(VCLLIB) \ + $(SFXLIB) + +#--------exports + +#specifies the exported symbols for Windows only: +SHL1DEF= $(MISC)$/$(SHL1TARGET).def + +#Specifies the library name to parse for symbols. For Win32 only. +#DEFLIB1NAME= _$(TARGET) + +#A file of symbols to export. +DEF1EXPORTFILE= $(PRJ)$/source$/inc$/exports.dxp + +#--------definition file + +#name of the definition file: +DEF1NAME= $(SHL1TARGET) + +# indicates definition file dependencies +DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt + +#A comment on the definition file. +DEF1DES= Viewable Component Chart View + +# --- Targets ----------------------------------------------------------------- + +.INCLUDE: target.mk + +# --- Filter ----------------------------------------------------------- + +$(MISC)$/$(SHL1TARGET).flt: makefile.mk \ + exports.flt + +$(TYPE) exports.flt > $@
\ No newline at end of file diff --git a/chart2/source/view/view.map b/chart2/source/view/view.map new file mode 100644 index 000000000000..706bab0af92b --- /dev/null +++ b/chart2/source/view/view.map @@ -0,0 +1,10 @@ +CHART_1_0 { + global: + component_getImplementationEnvironment; + component_writeInfo; + component_getFactory; + component_getDescriptionFunc; + + local: + *; +}; |