LCOV - code coverage report
Current view: top level - libreoffice/vcl/inc - graphite_features.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 1 0.0 %
Date: 2012-12-27 Functions: 0 1 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : // Description:
      21             : // Parse a string of features specified as ; separated pairs.
      22             : // e.g.
      23             : // 1001=1&2002=2&fav1=0
      24             : #include <sal/types.h>
      25             : #include <rtl/ustring.hxx>
      26             : #include <graphite2/Font.h>
      27             : 
      28             : namespace grutils
      29             : {
      30             :     union FeatId
      31             :     {
      32             :         gr_uint32 num;
      33             :         unsigned char label[5];
      34             :     };
      35             : 
      36             :     class GrFeatureParser
      37             :     {
      38             :     public:
      39             :         enum { MAX_FEATURES = 64 };
      40             :         static const char FEAT_PREFIX;
      41             :         static const char FEAT_SEPARATOR;
      42             :         static const char FEAT_ID_VALUE_SEPARATOR;
      43             :         GrFeatureParser(const gr_face * face, const ::rtl::OString features, const ::rtl::OString lang);
      44             :         GrFeatureParser(const gr_face * face, const ::rtl::OString lang);
      45             :         ~GrFeatureParser();
      46             :         //size_t getFontFeatures(gr::FeatureSetting settings[MAX_FEATURES]) const;
      47             :         bool parseErrors() { return mbErrors; };
      48             :         //static bool isValid(gr::Font & font, gr::FeatureSetting & setting);
      49             :         gr_uint32 getLanguage() const { return maLang.num; };
      50             :         bool hasLanguage() const { return (maLang.label[0] != '\0'); }
      51             :         sal_Int32 hashCode() const { return mnHash; }
      52             :         size_t numFeatures() const { return mnNumSettings; }
      53           0 :         gr_feature_val * values() const { return mpSettings; };
      54             :     private:
      55             :         GrFeatureParser(const GrFeatureParser & copy);
      56             :         void setLang(const gr_face * face, const ::rtl::OString & lang);
      57             :         bool isCharId(const ::rtl::OString & id, size_t offset, size_t length);
      58             :         gr_uint32 getCharId(const ::rtl::OString & id, size_t offset, size_t length);
      59             :         short getIntValue(const ::rtl::OString & id, size_t offset, size_t length);
      60             :         size_t mnNumSettings;
      61             :         FeatId maLang;
      62             :         bool mbErrors;
      63             :         sal_uInt32 mnHash;
      64             :         gr_feature_val * mpSettings;
      65             :     };
      66             : 
      67             : }
      68             : 
      69             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10