xlsx-1.1.2.2: Simple and incomplete Excel file parser/writer

Safe Haskell | Safe-Inferred
Language | Haskell2010

Codec.Xlsx.Types.RichText

Contents

- Main types
- Lenses
  - RichTextRun
  - RunProperties

Synopsis

- data RichTextRun = RichTextRun {
  - _richTextRunProperties :: Maybe RunProperties
  - _richTextRunText :: Text
  }
- data RunProperties = RunProperties {
  - _runPropertiesBold :: Maybe Bool
  - _runPropertiesCharset :: Maybe Int
  - _runPropertiesColor :: Maybe Color
  - _runPropertiesCondense :: Maybe Bool
  - _runPropertiesExtend :: Maybe Bool
  - _runPropertiesFontFamily :: Maybe FontFamily
  - _runPropertiesItalic :: Maybe Bool
  - _runPropertiesOutline :: Maybe Bool
  - _runPropertiesFont :: Maybe Text
  - _runPropertiesScheme :: Maybe FontScheme
  - _runPropertiesShadow :: Maybe Bool
  - _runPropertiesStrikeThrough :: Maybe Bool
  - _runPropertiesSize :: Maybe Double
  - _runPropertiesUnderline :: Maybe FontUnderline
  - _runPropertiesVertAlign :: Maybe FontVerticalAlignment
  }
- applyRunProperties :: RunProperties -> RichTextRun -> RichTextRun
- richTextRunProperties :: Lens' RichTextRun (Maybe RunProperties)
- richTextRunText :: Lens' RichTextRun Text
- runPropertiesBold :: Lens' RunProperties (Maybe Bool)
- runPropertiesCharset :: Lens' RunProperties (Maybe Int)
- runPropertiesColor :: Lens' RunProperties (Maybe Color)
- runPropertiesCondense :: Lens' RunProperties (Maybe Bool)
- runPropertiesExtend :: Lens' RunProperties (Maybe Bool)
- runPropertiesFontFamily :: Lens' RunProperties (Maybe FontFamily)
- runPropertiesItalic :: Lens' RunProperties (Maybe Bool)
- runPropertiesOutline :: Lens' RunProperties (Maybe Bool)
- runPropertiesFont :: Lens' RunProperties (Maybe Text)
- runPropertiesScheme :: Lens' RunProperties (Maybe FontScheme)
- runPropertiesShadow :: Lens' RunProperties (Maybe Bool)
- runPropertiesStrikeThrough :: Lens' RunProperties (Maybe Bool)
- runPropertiesSize :: Lens' RunProperties (Maybe Double)
- runPropertiesUnderline :: Lens' RunProperties (Maybe FontUnderline)
- runPropertiesVertAlign :: Lens' RunProperties (Maybe FontVerticalAlignment)

# Main types

data RichTextRun Source #

Rich Text Run

This element represents a run of rich text. A rich text run is a region of text that share a common set of properties, such as formatting properties.

Section 18.4.4, "r (Rich Text Run)" (p. 1724)

Constructors

RichTextRun |

Fields

- _richTextRunProperties :: Maybe RunProperties

  This element represents a set of properties to apply to the contents of this rich text run.

- _richTextRunText :: Text

  This element represents the text content shown as part of a string.

  NOTE: `RichTextRun` elements with an empty text field will result in an error when opening the file in Excel.

  Section 18.4.12, "t (Text)" (p. 1727)

#### Instances

Instances details

Generic RichTextRun Source # |
Instance details Defined in Codec.Xlsx.Types.RichText Associated Types type Rep RichTextRun :: Type -> Type Source # Methods from :: RichTextRun -> Rep RichTextRun x Source # to :: Rep RichTextRun x -> RichTextRun Source #
Show RichTextRun Source # |
Instance details Defined in Codec.Xlsx.Types.RichText Methods showsPrec :: Int -> RichTextRun -> ShowS Source # show :: RichTextRun -> String Source # showList :: [RichTextRun] -> ShowS Source #
Default RichTextRun Source # |
Instance details Defined in Codec.Xlsx.Types.RichText Methods def :: RichTextRun #
NFData RichTextRun Source # |
Instance details Defined in Codec.Xlsx.Types.RichText Methods rnf :: RichTextRun -> () Source #
Eq RichTextRun Source # |
Instance details Defined in Codec.Xlsx.Types.RichText Methods (==) :: RichTextRun -> RichTextRun -> Bool Source # (/=) :: RichTextRun -> RichTextRun -> Bool Source #
Ord RichTextRun Source # |

Instance details

Defined in Codec.Xlsx.Types.RichText

Methods

compare :: RichTextRun -> RichTextRun -> Ordering Source #

(<) :: RichTextRun -> RichTextRun -> Bool Source #

(<=) :: RichTextRun -> RichTextRun -> Bool Source #

(>) :: RichTextRun -> RichTextRun -> Bool Source #

(>=) :: RichTextRun -> RichTextRun -> Bool Source #

max :: RichTextRun -> RichTextRun -> RichTextRun Source #

min :: RichTextRun -> RichTextRun -> RichTextRun Source #

FromCursor RichTextRun Source # | See `CT_RElt`, p. 3903
Instance details Defined in Codec.Xlsx.Types.RichText Methods fromCursor :: Cursor -> [RichTextRun] Source #
FromXenoNode RichTextRun Source # |
Instance details Defined in Codec.Xlsx.Types.RichText Methods fromXenoNode :: Node -> Either Text RichTextRun Source #
ToElement RichTextRun Source # | See `CT_RElt`, p. 3903
Instance details Defined in Codec.Xlsx.Types.RichText Methods toElement :: Name -> RichTextRun -> Element Source #
type Rep RichTextRun Source # |

Instance details

Defined in Codec.Xlsx.Types.RichText

type Rep RichTextRun = D1 ('MetaData "RichTextRun" "Codec.Xlsx.Types.RichText" "xlsx-1.1.2.2-DopzEu8STPN4igxHgE9OUe" 'False) (C1 ('MetaCons "RichTextRun" 'PrefixI 'True) (S1 ('MetaSel ('Just "_richTextRunProperties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe RunProperties)) :*: S1 ('MetaSel ('Just "_richTextRunText") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data RunProperties Source #

Run properties

Section 18.4.7, "rPr (Run Properties)" (p. 1725)

Constructors

RunProperties |

Fields

- _runPropertiesBold :: Maybe Bool

  Displays characters in bold face font style.

  Section 18.8.2, "b (Bold)" (p. 1757)

- _runPropertiesCharset :: Maybe Int

  This element defines the font character set of this font.

  Section 18.4.1, "charset (Character Set)" (p. 1721)

- _runPropertiesColor :: Maybe Color

  One of the colors associated with the data bar or color scale.

  Section 18.3.1.15, "color (Data Bar Color)" (p. 1608)

- _runPropertiesCondense :: Maybe Bool

  Macintosh compatibility setting. Represents special word/character rendering on Macintosh, when this flag is set. The effect is to condense the text (squeeze it together).

  Section 18.8.12, "condense (Condense)" (p. 1764)

- _runPropertiesExtend :: Maybe Bool

  This element specifies a compatibility setting used for previous spreadsheet applications, resulting in special word/character rendering on those legacy applications, when this flag is set. The effect extends or stretches out the text.

  Section 18.8.17, "extend (Extend)" (p. 1766)

- _runPropertiesFontFamily :: Maybe FontFamily

  The font family this font belongs to. A font family is a set of fonts having common stroke width and serif characteristics. This is system level font information. The font name overrides when there are conflicting values.

  Section 18.8.18, "family (Font Family)" (p. 1766)

- _runPropertiesItalic :: Maybe Bool

  Displays characters in italic font style. The italic style is defined by the font at a system level and is not specified by ECMA-376.

  Section 18.8.26, "i (Italic)" (p. 1773)

- _runPropertiesOutline :: Maybe Bool

  This element displays only the inner and outer borders of each character. This is very similar to Bold in behavior.

  Section 18.4.2, "outline (Outline)" (p. 1722)

- _runPropertiesFont :: Maybe Text

  This element is a string representing the name of the font assigned to display this run.

  Section 18.4.5, "rFont (Font)" (p. 1724)

- _runPropertiesScheme :: Maybe FontScheme

  Defines the font scheme, if any, to which this font belongs. When a font definition is part of a theme definition, then the font is categorized as either a major or minor font scheme component. When a new theme is chosen, every font that is part of a theme definition is updated to use the new major or minor font definition for that theme. Usually major fonts are used for styles like headings, and minor fonts are used for body and paragraph text.

  Section 18.8.35, "scheme (Scheme)" (p. 1794)

- _runPropertiesShadow :: Maybe Bool

  Macintosh compatibility setting. Represents special word/character rendering on Macintosh, when this flag is set. The effect is to render a shadow behind, beneath and to the right of the text.

  Section 18.8.36, "shadow (Shadow)" (p. 1795)

- _runPropertiesStrikeThrough :: Maybe Bool

  This element draws a strikethrough line through the horizontal middle of the text.

  Section 18.4.10, "strike (Strike Through)" (p. 1726)

- _runPropertiesSize :: Maybe Double

  This element represents the point size (1/72 of an inch) of the Latin and East Asian text.

  Section 18.4.11, "sz (Font Size)" (p. 1727)

- _runPropertiesUnderline :: Maybe FontUnderline

  This element represents the underline formatting style.

  Section 18.4.13, "u (Underline)" (p. 1728)

- _runPropertiesVertAlign :: Maybe FontVerticalAlignment

  This element adjusts the vertical position of the text relative to the text's default appearance for this run. It is used to get `superscript` or `subscript` texts, and shall reduce the font size (if a smaller size is available) accordingly.

  Section 18.4.14, "vertAlign (Vertical Alignment)" (p. 1728)

#### Instances

Instances details

Monoid RunProperties Source # | The `Monoid` instance for `RunProperties` is biased: later properties override earlier ones.
Instance details Defined in Codec.Xlsx.Types.RichText Methods mempty :: RunProperties Source # mappend :: RunProperties -> RunProperties -> RunProperties Source # mconcat :: [RunProperties] -> RunProperties Source #
Semigroup RunProperties Source # |
Instance details Defined in Codec.Xlsx.Types.RichText Methods (<>) :: RunProperties -> RunProperties -> RunProperties Source # sconcat :: NonEmpty RunProperties -> RunProperties Source # stimes :: Integral b => b -> RunProperties -> RunProperties Source #
Generic RunProperties Source # |
Instance details Defined in Codec.Xlsx.Types.RichText Associated Types type Rep RunProperties :: Type -> Type Source # Methods from :: RunProperties -> Rep RunProperties x Source # to :: Rep RunProperties x -> RunProperties Source #
Show RunProperties Source # |
Instance details Defined in Codec.Xlsx.Types.RichText Methods showsPrec :: Int -> RunProperties -> ShowS Source # show :: RunProperties -> String Source # showList :: [RunProperties] -> ShowS Source #
Default RunProperties Source # |
Instance details Defined in Codec.Xlsx.Types.RichText Methods def :: RunProperties #
NFData RunProperties Source # |
Instance details Defined in Codec.Xlsx.Types.RichText Methods rnf :: RunProperties -> () Source #
Eq RunProperties Source # |
Instance details Defined in Codec.Xlsx.Types.RichText Methods (==) :: RunProperties -> RunProperties -> Bool Source # (/=) :: RunProperties -> RunProperties -> Bool Source #
Ord RunProperties Source # |

Instance details

Defined in Codec.Xlsx.Types.RichText

Methods

compare :: RunProperties -> RunProperties -> Ordering Source #

(<) :: RunProperties -> RunProperties -> Bool Source #

(<=) :: RunProperties -> RunProperties -> Bool Source #

(>) :: RunProperties -> RunProperties -> Bool Source #

(>=) :: RunProperties -> RunProperties -> Bool Source #

max :: RunProperties -> RunProperties -> RunProperties Source #

min :: RunProperties -> RunProperties -> RunProperties Source #

FromCursor RunProperties Source # | See `CT_RPrElt`, p. 3903
Instance details Defined in Codec.Xlsx.Types.RichText Methods fromCursor :: Cursor -> [RunProperties] Source #
FromXenoNode RunProperties Source # |
Instance details Defined in Codec.Xlsx.Types.RichText Methods fromXenoNode :: Node -> Either Text RunProperties Source #
ToElement RunProperties Source # | See `CT_RPrElt`, p. 3903
Instance details Defined in Codec.Xlsx.Types.RichText Methods toElement :: Name -> RunProperties -> Element Source #
type Rep RunProperties Source # |

Instance details

Defined in Codec.Xlsx.Types.RichText

type Rep RunProperties = D1 ('MetaData "RunProperties" "Codec.Xlsx.Types.RichText" "xlsx-1.1.2.2-DopzEu8STPN4igxHgE9OUe" 'False) (C1 ('MetaCons "RunProperties" 'PrefixI 'True) (((S1 ('MetaSel ('Just "_runPropertiesBold") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "_runPropertiesCharset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "_runPropertiesColor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Color)))) :*: ((S1 ('MetaSel ('Just "_runPropertiesCondense") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "_runPropertiesExtend") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "_runPropertiesFontFamily") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FontFamily)) :*: S1 ('MetaSel ('Just "_runPropertiesItalic") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))))) :*: (((S1 ('MetaSel ('Just "_runPropertiesOutline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "_runPropertiesFont") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "_runPropertiesScheme") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FontScheme)) :*: S1 ('MetaSel ('Just "_runPropertiesShadow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))) :*: ((S1 ('MetaSel ('Just "_runPropertiesStrikeThrough") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "_runPropertiesSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double))) :*: (S1 ('MetaSel ('Just "_runPropertiesUnderline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FontUnderline)) :*: S1 ('MetaSel ('Just "_runPropertiesVertAlign") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FontVerticalAlignment)))))))

applyRunProperties :: RunProperties -> RichTextRun -> RichTextRun Source #

Apply properties to a `RichTextRun`

If the `RichTextRun` specifies its own properties, then these overrule the properties specified here. For example, adding `bold` to a `RichTextRun` which is already `italic` will make the `RichTextRun` both `bold and` italic@ but adding it to one that that is explicitly _not_ bold will leave the `RichTextRun` unchanged.

# Lenses

## RichTextRun

richTextRunProperties :: Lens' RichTextRun (Maybe RunProperties) Source #

richTextRunText :: Lens' RichTextRun Text Source #

## RunProperties

runPropertiesBold :: Lens' RunProperties (Maybe Bool) Source #

runPropertiesCharset :: Lens' RunProperties (Maybe Int) Source #

runPropertiesColor :: Lens' RunProperties (Maybe Color) Source #

runPropertiesCondense :: Lens' RunProperties (Maybe Bool) Source #

runPropertiesExtend :: Lens' RunProperties (Maybe Bool) Source #

runPropertiesFontFamily :: Lens' RunProperties (Maybe FontFamily) Source #

runPropertiesItalic :: Lens' RunProperties (Maybe Bool) Source #

runPropertiesOutline :: Lens' RunProperties (Maybe Bool) Source #

runPropertiesFont :: Lens' RunProperties (Maybe Text) Source #

runPropertiesScheme :: Lens' RunProperties (Maybe FontScheme) Source #

runPropertiesShadow :: Lens' RunProperties (Maybe Bool) Source #

runPropertiesStrikeThrough :: Lens' RunProperties (Maybe Bool) Source #

runPropertiesSize :: Lens' RunProperties (Maybe Double) Source #

runPropertiesUnderline :: Lens' RunProperties (Maybe FontUnderline) Source #

runPropertiesVertAlign :: Lens' RunProperties (Maybe FontVerticalAlignment) Source #