xlnt/include/xlnt/styles/format.hpp

80 lines
2.5 KiB
C++
Raw Normal View History

2015-12-25 06:10:02 +08:00
// Copyright (c) 2014-2016 Thomas Fussell
2014-06-06 04:19:31 +08:00
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE
//
// @license: http://www.opensource.org/licenses/mit-license.php
// @author: see AUTHORS file
#pragma once
#include <cstddef>
#include <string>
#include <xlnt/xlnt_config.hpp>
2016-08-18 19:34:18 +08:00
#include <xlnt/styles/base_format.hpp>
2015-10-21 01:53:47 +08:00
2014-06-06 04:19:31 +08:00
namespace xlnt {
2015-10-19 03:30:46 +08:00
class alignment;
class border;
class fill;
class font;
class number_format;
class protection;
namespace detail {
struct format_impl;
struct stylesheet;
} // namespace detail
2016-05-01 23:08:56 +08:00
/// <summary>
/// Describes the formatting of a particular cell.
/// </summary>
2016-08-18 19:34:18 +08:00
class XLNT_CLASS format : public base_format
2014-06-06 04:19:31 +08:00
{
public:
2016-08-18 19:34:18 +08:00
std::size_t id() const;
2016-08-18 19:34:18 +08:00
bool has_style() const;
void style(const std::string &name);
void style(const xlnt::style &new_style);
2016-08-19 10:11:59 +08:00
const class style &style() const;
class font &font() override;
const class font &font() const override;
void font(const xlnt::font &new_font, bool applied) override;
2016-08-19 10:11:59 +08:00
class number_format &number_format() override;
const class number_format &number_format() const override;
2016-08-18 19:34:18 +08:00
void number_format(const xlnt::number_format &new_number_format, bool applied) override;
2016-08-18 19:34:18 +08:00
format &alignment_id(std::size_t id);
format &border_id(std::size_t id);
format &fill_id(std::size_t id);
format &font_id(std::size_t id);
format &number_format_id(std::size_t id);
format &protection_id(std::size_t id);
private:
friend struct detail::stylesheet;
format(detail::format_impl *d);
detail::format_impl *d_;
2014-06-06 04:19:31 +08:00
};
} // namespace xlnt