/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 .
*/
css::util::Color getCol(int r, int g, int b);
Reference<XComponent> openDraw(Reference<XComponentContext> xComponentContext);
Reference<XShape> createShape(Reference<XComponent> xDocComp, int height, int width, int x, int y,
OUString kind, css::util::Color col);
Reference<XShapeGroup> createSequence(Reference<XComponent> xDocComp, Reference<XDrawPage> xDP);
int main()
{
Reference<XComponentContext> xContext = NULL;
Reference<XShape> createShape(Reference<XComponent> xDocComp, int height, int width, int x, int y,
OUString kind, css::util::Color col)
{ // kind can be either 'Ellipse', 'Line' or 'Rectangle'
Size size;
Point position;
Reference<XShape> xShape;
// get the multiservice factory
Reference<XMultiServiceFactory> xDocMSF(xDocComp, UNO_QUERY);
Reference<XShapeGroup> createSequence(Reference<XComponent> xDocComp, Reference<XDrawPage> xDP)
{
Size size;
Point position;
Reference<XShape> xShape;
Reference<XShapes> xShapes(xDP, UNO_QUERY); int height = 2000; int width = 2500; int x = 1800; int y = 22000;
Reference<XInterface> oInt; int r = 30; int g = 0; int b = 70;
// getting the multiservice factory
Reference<XMultiServiceFactory> xDocMSF(xDocComp, UNO_QUERY);
for (int i = 0; i < 380; i = i + 30)
{ try
{
oInt = xDocMSF->createInstance("com.sun.star.drawing.EllipseShape");
xShape = Reference<XShape>(oInt, UNO_QUERY);
size.Height = height;
size.Width = width;
position.X = x + (i * 40);
position.Y = y + (i * 40) % 4000;
xShape->setSize(size);
xShape->setPosition(position);
} catch (Exception e)
{ // Some exception occurs.FAILED
std::cout << "Could not get Shape." << std::endl << e.Message << std::endl; exit(1);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.