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
|
|
|
|
|
2016-08-16 12:23:49 +08:00
|
|
|
#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
|
|
|
|
2016-08-16 12:23:49 +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
|
|
|
|
2015-11-21 09:41:32 +08:00
|
|
|
/// <summary>
|
2016-05-01 04:19:45 +08:00
|
|
|
/// Describes the formatting of a particular cell.
|
2015-11-21 09:41:32 +08:00
|
|
|
/// </summary>
|
2016-11-03 10:04:51 +08:00
|
|
|
class XLNT_API format : public base_format
|
2014-06-06 04:19:31 +08:00
|
|
|
{
|
2015-12-25 04:51:11 +08:00
|
|
|
public:
|
2016-11-03 10:04:51 +08:00
|
|
|
std::size_t id() const;
|
2016-08-16 12:23:49 +08:00
|
|
|
|
2016-11-03 10:04:51 +08:00
|
|
|
bool has_style() const;
|
|
|
|
void clear_style();
|
|
|
|
void style(const std::string &name);
|
|
|
|
void style(const xlnt::style &new_style);
|
|
|
|
const class style &style() const;
|
2016-09-10 22:05:06 +08:00
|
|
|
|
2016-11-03 10:04:51 +08:00
|
|
|
class border &border() override;
|
|
|
|
const class border &border() const override;
|
|
|
|
void border(const xlnt::border &new_border, bool applied) override;
|
2016-09-10 22:05:06 +08:00
|
|
|
|
2016-11-03 10:04:51 +08:00
|
|
|
class fill &fill() override;
|
|
|
|
const class fill &fill() const override;
|
|
|
|
void fill(const xlnt::fill &new_fill, bool applied) override;
|
2016-09-08 06:02:46 +08:00
|
|
|
|
2016-11-03 10:04:51 +08:00
|
|
|
class font &font() override;
|
|
|
|
const class font &font() const override;
|
|
|
|
void font(const xlnt::font &new_font, bool applied) override;
|
2016-08-16 12:23:49 +08:00
|
|
|
|
2016-11-03 10:04:51 +08:00
|
|
|
class number_format &number_format() override;
|
|
|
|
const class number_format &number_format() const override;
|
|
|
|
void number_format(const xlnt::number_format &new_number_format, bool applied) override;
|
2016-08-16 12:23:49 +08:00
|
|
|
|
2016-11-03 10:04:51 +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);
|
2016-08-16 12:23:49 +08:00
|
|
|
|
|
|
|
private:
|
2016-11-03 10:04:51 +08:00
|
|
|
friend struct detail::stylesheet;
|
|
|
|
format(detail::format_impl *d);
|
|
|
|
detail::format_impl *d_;
|
2014-06-06 04:19:31 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace xlnt
|