/* -*- 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 . */ #ifndef INCLUDED_EDITENG_FLDITEM_HXX #define INCLUDED_EDITENG_FLDITEM_HXX #include #include #include #include #include #include #include #include namespace com { namespace sun { namespace star { namespace text { class XTextContent; }}}} class SvNumberFormatter; class MetaAction; // class SvxFieldItem --------------------------------------------------- class EDITENG_DLLPUBLIC SvxFieldData : public SvPersistBase { public: static const sal_Int32 UNKNOWN_FIELD; static SvxFieldData* Create(const com::sun::star::uno::Reference& xContent); SV_DECL_PERSIST1( SvxFieldData, SvPersistBase, com::sun::star::text::textfield::Type::UNSPECIFIED) SvxFieldData(); virtual ~SvxFieldData(); virtual SvxFieldData* Clone() const; virtual bool operator==( const SvxFieldData& ) const; virtual MetaAction* createBeginComment() const; virtual MetaAction* createEndComment() const; }; /** * This item stores a field (SvxFieldData). The field is controlled by or * belongs to the item. The field itself is determined by a derivation from * SvxFieldData (RTTI) */ class EDITENG_DLLPUBLIC SvxFieldItem : public SfxPoolItem { private: SvxFieldData* pField; EDITENG_DLLPRIVATE SvxFieldItem( SvxFieldData* pField, const sal_uInt16 nId ); public: TYPEINFO_OVERRIDE(); SvxFieldItem( const SvxFieldData& rField, const sal_uInt16 nId ); SvxFieldItem( const SvxFieldItem& rItem ); virtual ~SvxFieldItem(); virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE; virtual SfxPoolItem* Create( SvStream&, sal_uInt16 nVer ) const SAL_OVERRIDE; virtual SvStream& Store( SvStream& , sal_uInt16 nItemVersion ) const SAL_OVERRIDE; const SvxFieldData* GetField() const { return pField; } static SvClassManager& GetClassManager(); }; // The following are the derivatives of SvxFieldData ... enum SvxDateType { SVXDATETYPE_FIX, SVXDATETYPE_VAR }; enum SvxDateFormat { SVXDATEFORMAT_APPDEFAULT = 0, // Set as in App SVXDATEFORMAT_SYSTEM, // Set as in System SVXDATEFORMAT_STDSMALL, SVXDATEFORMAT_STDBIG, SVXDATEFORMAT_A, // 13.02.96 SVXDATEFORMAT_B, // 13.02.1996 SVXDATEFORMAT_C, // 13.Feb 1996 SVXDATEFORMAT_D, // 13.February 1996 SVXDATEFORMAT_E, // Tue, 13.February 1996 SVXDATEFORMAT_F // Tuesday, 13.February 1996 }; class EDITENG_DLLPUBLIC SvxDateField : public SvxFieldData { sal_uInt32 nFixDate; SvxDateType eType; SvxDateFormat eFormat; public: SV_DECL_PERSIST1( SvxDateField, SvxFieldData, com::sun::star::text::textfield::Type::DATE ) SvxDateField(); explicit SvxDateField( const Date& rDate, SvxDateType eType = SVXDATETYPE_VAR, SvxDateFormat eFormat = SVXDATEFORMAT_STDSMALL ); sal_uInt32 GetFixDate() const { return nFixDate; } void SetFixDate( const Date& rDate ) { nFixDate = rDate.GetDate(); } SvxDateType GetType() const { return eType; } void SetType( SvxDateType eTp ) { eType = eTp; } SvxDateFormat GetFormat() const { return eFormat; } void SetFormat( SvxDateFormat eFmt ) { eFormat = eFmt; } // If eLanguage==LANGUAGE_DONTKNOW the language/country // used in number formatter initialization is taken. OUString GetFormatted( SvNumberFormatter& rFormatter, LanguageType eLanguage ) const; static OUString GetFormatted( Date& rDate, SvxDateFormat eFormat, SvNumberFormatter& rFormatter, LanguageType eLanguage ); virtual SvxFieldData* Clone() const SAL_OVERRIDE; virtual bool operator==( const SvxFieldData& ) const SAL_OVERRIDE; virtual MetaAction* createBeginComment() const SAL_OVERRIDE; }; enum SvxURLFormat { SVXURLFORMAT_APPDEFAULT = 0, // Set as in App SVXURLFORMAT_URL, // Represent URL SVXURLFORMAT_REPR // Constitute repraesentation }; class EDITENG_DLLPUBLIC SvxURLField : public SvxFieldData { private: SvxURLFormat eFormat; OUString aURL; // URL-Address OUString aRepresentation; // What is shown OUString aTargetFrame; // In what Frame public: SV_DECL_PERSIST1( SvxURLField, SvxFieldData, com::sun::star::text::textfield::Type::URL ) SvxURLField(); SvxURLField( const OUString& rURL, const OUString& rRepres, SvxURLFormat eFmt = SVXURLFORMAT_URL ); const OUString& GetURL() const { return aURL; } void SetURL( const OUString& rURL ) { aURL = rURL; } const OUString& GetRepresentation() const { return aRepresentation; } void SetRepresentation( const OUString& rRep ) { aRepresentation= rRep; } const OUString& GetTargetFrame() const { return aTargetFrame; } void SetTargetFrame( const OUString& rFrm ) { aTargetFrame = rFrm; } SvxURLFormat GetFormat() const { return eFormat; } void SetFormat( SvxURLFormat eFmt ) { eFormat = eFmt; } virtual SvxFieldData* Clone() const SAL_OVERRIDE; virtual bool operator==( const SvxFieldData& ) const SAL_OVERRIDE; virtual MetaAction* createBeginComment() const SAL_OVERRIDE; }; class EDITENG_DLLPUBLIC SvxPageField : public SvxFieldData { public: SV_DECL_PERSIST1( SvxPageField, SvxFieldData, com::sun::star::text::textfield::Type::PAGE ) SvxPageField(); virtual SvxFieldData* Clone() const SAL_OVERRIDE; virtual bool operator==( const SvxFieldData& ) const SAL_OVERRIDE; virtual MetaAction* createBeginComment() const SAL_OVERRIDE; }; class EDITENG_DLLPUBLIC SvxPagesField : public SvxFieldData { public: SV_DECL_PERSIST1( SvxPagesField, SvxFieldData, com::sun::star::text::textfield::Type::PAGES ) SvxPagesField(); virtual SvxFieldData* Clone() const SAL_OVERRIDE; virtual bool operator==( const SvxFieldData& ) const SAL_OVERRIDE; }; class EDITENG_DLLPUBLIC SvxTimeField : public SvxFieldData { public: SV_DECL_PERSIST1( SvxTimeField, SvxFieldData, com::sun::star::text::textfield::Type::TIME ) SvxTimeField(); virtual SvxFieldData* Clone() const SAL_OVERRIDE; virtual bool operator==( const SvxFieldData& ) const SAL_OVERRIDE; virtual MetaAction* createBeginComment() const SAL_OVERRIDE; }; class EDITENG_DLLPUBLIC SvxFileField : public SvxFieldData { public: SV_DECL_PERSIST1( SvxFileField, SvxFieldData, com::sun::star::text::textfield::Type::DOCINFO_TITLE ) SvxFileField(); virtual SvxFieldData* Clone() const SAL_OVERRIDE; virtual bool operator==( const SvxFieldData& ) const SAL_OVERRIDE; }; class EDITENG_DLLPUBLIC SvxTableField : public SvxFieldData { int mnTab; public: SV_DECL_PERSIST1( SvxTableField, SvxFieldData, com::sun::star::text::textfield::Type::TABLE ) SvxTableField(); explicit SvxTableField(int nTab); void SetTab(int nTab); int GetTab() const { return mnTab;} virtual SvxFieldData* Clone() const SAL_OVERRIDE; virtual bool operator==( const SvxFieldData& ) const SAL_OVERRIDE; }; enum SvxTimeType { SVXTIMETYPE_FIX, SVXTIMETYPE_VAR }; enum SvxTimeFormat { SVXTIMEFORMAT_APPDEFAULT = 0, // Set as in App SVXTIMEFORMAT_SYSTEM, // Set as in System SVXTIMEFORMAT_STANDARD, SVXTIMEFORMAT_24_HM, // 13:49 SVXTIMEFORMAT_24_HMS, // 13:49:38 SVXTIMEFORMAT_24_HMSH, // 13:49:38.78 SVXTIMEFORMAT_12_HM, // 01:49 SVXTIMEFORMAT_12_HMS, // 01:49:38 SVXTIMEFORMAT_12_HMSH, // 01:49:38.78 SVXTIMEFORMAT_AM_HM, // 01:49 PM SVXTIMEFORMAT_AM_HMS, // 01:49:38 PM SVXTIMEFORMAT_AM_HMSH // 01:49:38.78 PM }; class EDITENG_DLLPUBLIC SvxExtTimeField : public SvxFieldData { private: sal_Int64 m_nFixTime; SvxTimeType eType; SvxTimeFormat eFormat; public: SV_DECL_PERSIST1( SvxExtTimeField, SvxFieldData, com::sun::star::text::textfield::Type::EXTENDED_TIME ) SvxExtTimeField(); explicit SvxExtTimeField( const Time& rTime, SvxTimeType eType = SVXTIMETYPE_VAR, SvxTimeFormat eFormat = SVXTIMEFORMAT_STANDARD ); sal_Int64 GetFixTime() const { return m_nFixTime; } void SetFixTime( const Time& rTime ) { m_nFixTime = rTime.GetTime(); } SvxTimeType GetType() const { return eType; } void SetType( SvxTimeType eTp ) { eType = eTp; } SvxTimeFormat GetFormat() const { return eFormat; } void SetFormat( SvxTimeFormat eFmt ) { eFormat = eFmt; } // If eLanguage==LANGUAGE_DONTKNOW the language/country // used in number formatter initialization is taken. OUString GetFormatted( SvNumberFormatter& rFormatter, LanguageType eLanguage ) const; static OUString GetFormatted( Time& rTime, SvxTimeFormat eFormat, SvNumberFormatter& rFormatter, LanguageType eLanguage ); virtual SvxFieldData* Clone() const SAL_OVERRIDE; virtual bool operator==( const SvxFieldData& ) const SAL_OVERRIDE; virtual MetaAction* createBeginComment() const SAL_OVERRIDE; }; enum SvxFileType { SVXFILETYPE_FIX, SVXFILETYPE_VAR }; enum SvxFileFormat { SVXFILEFORMAT_NAME_EXT = 0, // File name with Extension SVXFILEFORMAT_FULLPATH, // full path SVXFILEFORMAT_PATH, // only path SVXFILEFORMAT_NAME // only file name }; class EDITENG_DLLPUBLIC SvxExtFileField : public SvxFieldData { private: OUString aFile; SvxFileType eType; SvxFileFormat eFormat; public: SV_DECL_PERSIST1( SvxExtFileField, SvxFieldData, com::sun::star::text::textfield::Type::EXTENDED_FILE ) SvxExtFileField(); explicit SvxExtFileField( const OUString& rString, SvxFileType eType = SVXFILETYPE_VAR, SvxFileFormat eFormat = SVXFILEFORMAT_FULLPATH ); OUString GetFile() const { return aFile; } void SetFile( const OUString& rString ) { aFile = rString; } SvxFileType GetType() const { return eType; } void SetType( SvxFileType eTp ) { eType = eTp; } SvxFileFormat GetFormat() const { return eFormat; } void SetFormat( SvxFileFormat eFmt ) { eFormat = eFmt; } OUString GetFormatted() const; virtual SvxFieldData* Clone() const SAL_OVERRIDE; virtual bool operator==( const SvxFieldData& ) const SAL_OVERRIDE; }; enum SvxAuthorType { SVXAUTHORTYPE_FIX, SVXAUTHORTYPE_VAR }; enum SvxAuthorFormat { SVXAUTHORFORMAT_FULLNAME = 0, // full name SVXAUTHORFORMAT_NAME, // Only Last name SVXAUTHORFORMAT_FIRSTNAME, // Only first name SVXAUTHORFORMAT_SHORTNAME // Initials }; class EDITENG_DLLPUBLIC SvxAuthorField : public SvxFieldData { private: OUString aName; OUString aFirstName; OUString aShortName; SvxAuthorType eType; SvxAuthorFormat eFormat; public: SV_DECL_PERSIST1( SvxAuthorField, SvxFieldData, com::sun::star::text::textfield::Type::AUTHOR ) SvxAuthorField(); SvxAuthorField( const OUString& rFirstName, const OUString& rLastName, const OUString& rShortName, SvxAuthorType eType = SVXAUTHORTYPE_VAR, SvxAuthorFormat eFormat = SVXAUTHORFORMAT_FULLNAME ); OUString GetName() const { return aName; } void SetName( const OUString& rString ) { aName = rString; } OUString GetFirstName() const { return aFirstName; } void SetFirstName( const OUString& rString ) { aFirstName = rString; } OUString GetShortName() const { return aShortName; } void SetShortName( const OUString& rString ) { aShortName = rString; } SvxAuthorType GetType() const { return eType; } void SetType( SvxAuthorType eTp ) { eType = eTp; } SvxAuthorFormat GetFormat() const { return eFormat; } void SetFormat( SvxAuthorFormat eFmt ) { eFormat = eFmt; } OUString GetFormatted() const; virtual SvxFieldData* Clone() const SAL_OVERRIDE; virtual bool operator==( const SvxFieldData& ) const SAL_OVERRIDE; }; /** this field is used as a placeholder for a header&footer in impress. The actual value is stored at the page */ class EDITENG_DLLPUBLIC SvxHeaderField : public SvxFieldData { public: SV_DECL_PERSIST1( SvxHeaderField, SvxFieldData, com::sun::star::text::textfield::Type::PRESENTATION_HEADER ) SvxHeaderField(); virtual SvxFieldData* Clone() const SAL_OVERRIDE; virtual bool operator==( const SvxFieldData& ) const SAL_OVERRIDE; }; /** this field is used as a placeholder for a header&footer in impress. The actual value is stored at the page */ class EDITENG_DLLPUBLIC SvxFooterField : public SvxFieldData { public: SV_DECL_PERSIST1( SvxFooterField, SvxFieldData, com::sun::star::text::textfield::Type::PRESENTATION_FOOTER ) SvxFooterField(); virtual SvxFieldData* Clone() const SAL_OVERRIDE; virtual bool operator==( const SvxFieldData& ) const SAL_OVERRIDE; }; /** this field is used as a placeholder for a header&footer in impress. The actual value is stored at the page */ class EDITENG_DLLPUBLIC SvxDateTimeField : public SvxFieldData { public: SV_DECL_PERSIST1( SvxDateTimeField, SvxFieldData, com::sun::star::text::textfield::Type::PRESENTATION_DATE_TIME ) SvxDateTimeField(); static OUString GetFormatted( Date& rDate, Time& rTime, int eFormat, SvNumberFormatter& rFormatter, LanguageType eLanguage ); virtual SvxFieldData* Clone() const SAL_OVERRIDE; virtual bool operator==( const SvxFieldData& ) const SAL_OVERRIDE; }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ature/drop-findcmap'>feature/drop-findcmap LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
Now column headers and table data show up on the UI. Change-Id: I84100c5a7ac65c3be1e985be8ae7195835c45145 Reviewed-on: https://gerrit.libreoffice.org/40128 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
AgeCommit message (Collapse)Author
2024-11-07loplugin:passstuffbyref in chart2..connectivityNoel Grandin
Change-Id: Ic2c6606ea0ce1d5c3089bc4c1a879fed3f2c7aff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176180 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-01Avoid some macOS loplugin warnings around SQLWCharsStephan Bergmann
...like > connectivity/source/drivers/odbc/OPreparedStatement.cxx:285:136: error: replace function parameter of type 'const OUString &' with 'std::u16string_view' [loplugin:stringviewparam] > 285 | void OPreparedStatement::setParameter(const sal_Int32 parameterIndex, const sal_Int32 _nType, const sal_Int16 _nScale, const OUString &_sData) > | ~~~~~~~~~~~~~~~~^~~~~~ and > connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx:851:117: error: directly use a 'std::u16string_view' (aka 'basic_string_view<char16_t>') value instead of a _ustr user-defined string literal [loplugin:ostr] > 851 | SQLWChars aCOL = !uCOL.isEmpty() ? SQLWChars(uCOL.makeStringAndClear()) : SQLWChars(u"" SQL_ALL_TABLE_TYPES ""_ustr); > | ^~~~~~~ caused by SQLWCHAR being 32-bit wchar_t on macOS (rather than 16-bit unsigned short, as on Linux), so SQLWChars is CHARS<sal_uInt32> (rather than CHARS<sal_Unicode>) with a ctor taking a std::u16string_view argument (rather than an OUString argument) Change-Id: I194af5feda5ba6279ed87264bc467b5d574406cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174263 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-09-30use more concrete UNO type in odbc::OStatement_BaseNoel Grandin
Change-Id: I86073baf25e2f10a57879fcedbbb1c0e8c354813 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174281 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-09-12use more concrete UNO classes in connectivityNoel Grandin
Change-Id: I5c70278add0aa0b0c4a7680c6615b75b688f2180 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173247 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-07-28Fix typoAndrea Gelmini
Change-Id: I7a135a47e5bdbbf37a08f7e876a0ed1d979d4c39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171131 Tested-by: Jenkins Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2024-07-27tdf#68676, tdf#131238: implement and use Unicode ODBC functions on WindowsMike Kaganski
It also prepares for using it on other platforms as well; the code is generic, and should work with 32-bit SQLWCHAR, too. But I can't test it, so it is not enabled on other platforms for now (see bUseWChar, which was moved to connectivity/source/inc/odbc/OTools.hxx). Change-Id: I29fe117910bbab62aba37e85dd27d65a742d28c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171081 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-07-26Refactor ODBC functions code for clarityMike Kaganski
Change-Id: I5f3de97fc178b11c82655f65435c637fdff65e99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171080 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-02-19hide more symbolsNoel Grandin
using the bin/find-can-be-private-symbols.py script to find classes with large numbers of exported symbols that can hidden. before exported = 58104 imported = 30810 unused_exports = 35433 after exported = 55094 imported = 31073 unused_exports = 32423 Change-Id: Idd0a70ee3740afd5ca1a86771e0e2ff8090d102d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163456 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-13clang-tidy modernize-pass-by-value in connectivityNoel Grandin
Change-Id: I1f1b609254c7f8cfba14c248167f81b51684d8e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135727 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-26cid#1500433 Using a moved objectCaolán McNamara
Change-Id: I150cd0f021aeb1aefe411f19dfcac111ac35b295 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130592 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2017-07-18connectivity writer driver: add PreparedStatement implementationMiklos Vajna
Gets rid of the stub warnings in OWriterConnection::prepareStatement(). Change-Id: I05db81898d8117578130e660932608fcc927edf0 Reviewed-on: https://gerrit.libreoffice.org/40092 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-07-18connectivity writer driver: add Columns implementationMiklos Vajna
Gets rid of the stub warnings in OWriterTable::refreshColumns(). Change-Id: I2dd43777a00a6958548e3dc8119c5cb825ebb02e Reviewed-on: https://gerrit.libreoffice.org/40091 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-07-18connectivity writer driver: add Table implementationMiklos Vajna
Gets rid of the stub warnings in OWriterTables::createObject(). Change-Id: I161e498d5704bb9a3d9f423ce1823664d8249c86 Reviewed-on: https://gerrit.libreoffice.org/40090 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-07-18connectivity writer driver: add Tables implementationMiklos Vajna
But leave OWriterTables::createObject() as a stub for now. Change-Id: I8a05d698e565cefded1286decdfbdfece8c2237b
2017-07-18connectivity writer driver: add Catalog implementationMiklos Vajna
But leave OWriterCatalog::refreshTables() as a stub for now. Change-Id: Ica5eb9d45937c826501b666d565019e2e04df6bf Reviewed-on: https://gerrit.libreoffice.org/40071 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-07-17connectivity writer driver: initial DatabaseMetaData implementationMiklos Vajna
With this the list of tables is visible in Data Sources. Change-Id: I7ee4955c54a76c57f854dba19fd1a6a8ee606089 Reviewed-on: https://gerrit.libreoffice.org/40056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-07-17connectivity: add initial writer backendMiklos Vajna
Similar to the calc one. As a first step the Driver and the Connection interfaces are implemented, though the later has some stubs. Change-Id: Id043f7742fdb2006d4f88526ef4d055a6d8dee82 Reviewed-on: https://gerrit.libreoffice.org/40033 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>